Explorar o código

staging: mt7621-gpio: use ternary operator in return in mediatek_gpio_get_direction

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

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sergio Paracuellos %!s(int64=7) %!d(string=hai) anos
pai
achega
b36dd3af48
Modificáronse 1 ficheiros con 1 adicións e 4 borrados
  1. 1 4
      drivers/staging/mt7621-gpio/gpio-mt7621.c

+ 1 - 4
drivers/staging/mt7621-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