drivers: gpio_cmsdk_ahb: Fix erronous if statements
The GPIO_INT_LEVEL and GPIO_INT_ACTIVE_LOW values are zero so the statements are never executed then is better use the bit complement masks This issue was reported by Coverity Coverity-CID: 157586 Change-Id: Ic8b20660a991dd3d0c71248f84c917e5ce5c3c7c Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
This commit is contained in:
parent
814534ba4e
commit
b52080749f
1 changed files with 4 additions and 4 deletions
|
@ -82,7 +82,7 @@ static void cmsdk_ahb_gpio_config(struct device *dev, uint32_t mask, int flags)
|
|||
*/
|
||||
if (flags & GPIO_INT_EDGE) {
|
||||
cfg->port->inttypeclr = mask;
|
||||
} else if (flags & GPIO_INT_LEVEL) {
|
||||
} else {
|
||||
cfg->port->inttypeset = mask;
|
||||
}
|
||||
/*
|
||||
|
@ -90,10 +90,10 @@ static void cmsdk_ahb_gpio_config(struct device *dev, uint32_t mask, int flags)
|
|||
* 0 - Low level or falling edge
|
||||
* 1 - High level or rising edge
|
||||
*/
|
||||
if (flags & GPIO_INT_ACTIVE_LOW) {
|
||||
cfg->port->intpolclr = mask;
|
||||
} else if (flags & GPIO_INT_ACTIVE_HIGH) {
|
||||
if (flags & GPIO_INT_ACTIVE_HIGH) {
|
||||
cfg->port->intpolset = mask;
|
||||
} else {
|
||||
cfg->port->intpolclr = mask;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue