On Tue 05 Apr 06:10 PDT 2016, Linus Walleij wrote: > This switch to use BIT(n) instead of (1 << n) which is less > to the point. Most GPIO drivers do this to avoid mistakes. > Also switch from using <linux/gpio.h> to the apropriate > <linux/gpio/driver.h> include. > > Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx> > --- > drivers/gpio/gpio-tc3589x.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpio/gpio-tc3589x.c b/drivers/gpio/gpio-tc3589x.c [..] > @@ -55,7 +56,7 @@ static void tc3589x_gpio_set(struct gpio_chip *chip, unsigned offset, int val) > struct tc3589x *tc3589x = tc3589x_gpio->tc3589x; > u8 reg = TC3589x_GPIODATA0 + (offset / 8) * 2; > unsigned pos = offset % 8; > - u8 data[] = {!!val << pos, 1 << pos}; > + u8 data[] = {!!val << pos, BIT(pos)}; ^ | The first part of this is also a bitmask, so even though this is slightly messier I think for consistency you should go with: u8 data[] = {val ? BIT(pos) : 0, BIT(pos)}; > > tc3589x_block_write(tc3589x, reg, ARRAY_SIZE(data), data); > } The rest looks good, Reviewed-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx> Regards, Bjorn -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html