Skip to content

Commit

Permalink
gpio: gpio_intel_apl: fix if condition leading to dead code
Browse files Browse the repository at this point in the history
GPIO_INT_ACTIVE_LOW is 0 which means it cannot be simply AND-ed.
So fix the condition.

Fixes zephyrproject-rtos#13880

Signed-off-by: Daniel Leung <[email protected]>
  • Loading branch information
dcpleung authored and andrewboie committed Feb 28, 2019
1 parent ca3b6c6 commit 1af5fa1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpio/gpio_intel_apl.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ static int gpio_intel_apl_config(struct device *dev, int access_op,
/* setup interrupt if desired */
if (flags & GPIO_INT) {
/* invert signal for interrupt controller */
if (flags & GPIO_INT_ACTIVE_LOW) {
if ((flags & GPIO_INT_ACTIVE_HIGH) == GPIO_INT_ACTIVE_LOW) {
cfg0 |= PAD_CFG0_RXINV;
}

Expand Down

0 comments on commit 1af5fa1

Please sign in to comment.