gpiolib: fix gpiochip_machine_hog()
Subsystems (2)
PATCH 1/1 gpiolib: fix gpiochip_machine_hog()
There is a shifter vs vanilla mask bug here. We want to test if 1 << 11 is set but we're testing if 0xb is set.
Fixes 9a6c505f7df1 ("gpiolib: add hogs support for machine code")
Signed-off-by Dan Carpenter <[email protected]>
drivers/gpio/gpiolib.c +1 -1
@@ -1187,7 +1187,7 @@ static void gpiochip_machine_hog(struct gpio_chip *chip, struct gpiod_hog *hog)return ; } -if (desc->flags &FLAG_IS_HOGGED ) +if (test_bit (FLAG_IS_HOGGED , &desc->flags))return ; rv =gpiod_hog (desc, hog->line_name, hog->lflags, hog->dflags);
2018-05-01 9:36 GMT+02:00 Dan Carpenter <[email protected]>:
Quoted 11 lines
There is a shifter vs vanilla mask bug here. We want to test if 1 << 11 is set but we're testing if
0xbis set.Fixes 9a6c505f7df1 ("gpiolib: add hogs support for machine code")Signed-off-by Dan Carpenter <[email protected]>drivers/gpio/gpiolib.c +0
-0
drivers/gpio/gpiolib.c static void gpiochip_machine_hog(struct gpio_chip *chip, struct gpiod_hog *hog) · line 1193
Quoted 8 lines
drivers/gpio/gpiolib.c +1
-1@@ -1187,7 +1187,7 @@ static void gpiochip_machine_hog(struct gpio_chip *chip, struct gpiod_hog *hog)return ; } -if (desc->flags &FLAG_IS_HOGGED ) +if (test_bit (FLAG_IS_HOGGED , &desc->flags))return ; rv =gpiod_hog (desc, hog->line_name, hog->lflags, hog->dflags);
Thanks for catching it!
Reviewed-by Bartosz Golaszewski <[email protected]>
Quoted 5 lines · Dan Carpenter
There is a shifter vs vanilla mask bug here. We want to test if 1 << 11 is set but we're testing if
0xbis set.Fixes 9a6c505f7df1 ("gpiolib: add hogs support for machine code")Signed-off-by Dan Carpenter <[email protected]>
Patch applied with Bartosz review tag.
Yours,
Linus Walleij