Skip to content

Commit 1af5fa1

Browse files
dcpleungandrewboie
authored andcommitted
gpio: gpio_intel_apl: fix if condition leading to dead code
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 <daniel.leung@intel.com>
1 parent ca3b6c6 commit 1af5fa1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpio/gpio_intel_apl.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static int gpio_intel_apl_config(struct device *dev, int access_op,
243243
/* setup interrupt if desired */
244244
if (flags & GPIO_INT) {
245245
/* invert signal for interrupt controller */
246-
if (flags & GPIO_INT_ACTIVE_LOW) {
246+
if ((flags & GPIO_INT_ACTIVE_HIGH) == GPIO_INT_ACTIVE_LOW) {
247247
cfg0 |= PAD_CFG0_RXINV;
248248
}
249249

0 commit comments

Comments
 (0)