mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
gpio: pch: Optimize pch_gpio_get()
The double negation is costly and can be avoided by shifting the register value before masking the requested bit. Signed-off-by: Jean Delvare <[email protected]> Cc: Linus Walleij <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
446f59acb7
commit
166814d841
1 changed files with 1 additions and 1 deletions
|
|
@ -127,7 +127,7 @@ static int pch_gpio_get(struct gpio_chip *gpio, unsigned nr)
|
|||
{
|
||||
struct pch_gpio *chip = gpiochip_get_data(gpio);
|
||||
|
||||
return !!(ioread32(&chip->reg->pi) & (1 << nr));
|
||||
return (ioread32(&chip->reg->pi) >> nr) & 1;
|
||||
}
|
||||
|
||||
static int pch_gpio_direction_output(struct gpio_chip *gpio, unsigned nr,
|
||||
|
|
|
|||
Loading…
Reference in a new issue