From: Sergio Paracuellos <[email protected]>

This commits replaces if statement and two returns in favour
of a only one return using a ternary operator.

Signed-off-by: Sergio Paracuellos <[email protected]>
Reviewed-by: NeilBrown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 target/linux/ramips/files-4.14/drivers/gpio/gpio-mt7621.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/target/linux/ramips/files-4.14/drivers/gpio/gpio-mt7621.c 
b/target/linux/ramips/files-4.14/drivers/gpio/gpio-mt7621.c
index bbe6cce56d..15a1003017 100644
--- a/target/linux/ramips/files-4.14/drivers/gpio/gpio-mt7621.c
+++ b/target/linux/ramips/files-4.14/drivers/gpio/gpio-mt7621.c
@@ -135,10 +135,7 @@ mediatek_gpio_get_direction(struct gpio_chip *chip, 
unsigned int offset)
        t = mtk_gpio_r32(rg, GPIO_REG_CTRL);
        spin_unlock_irqrestore(&rg->lock, flags);
 
-       if (t & BIT(offset))
-               return 0;
-
-       return 1;
+       return (t & BIT(offset)) ? 0 : 1;
 }
 
 static int
-- 
2.17.0


_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/listinfo/openwrt-devel

Reply via email to