On Thu, Apr 09, 2020 at 05:12:23PM +0300, Andy Shevchenko wrote: > More usual pattern is to prepare value and then write it in a single place. > Switch code in dwapb_gpio_set_debounce() to it. Seems appropriate. Thanks. Reviewed-by: Serge Semin <fancer.lancer@xxxxxxxxx> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> > --- > drivers/gpio/gpio-dwapb.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c > index 916a42fea456..a15652ff9495 100644 > --- a/drivers/gpio/gpio-dwapb.c > +++ b/drivers/gpio/gpio-dwapb.c > @@ -327,9 +327,10 @@ static int dwapb_gpio_set_debounce(struct gpio_chip *gc, > > val_deb = dwapb_read(gpio, GPIO_PORTA_DEBOUNCE); > if (debounce) > - dwapb_write(gpio, GPIO_PORTA_DEBOUNCE, val_deb | mask); > + val_deb |= mask; > else > - dwapb_write(gpio, GPIO_PORTA_DEBOUNCE, val_deb & ~mask); > + val_deb &= ~mask; > + dwapb_write(gpio, GPIO_PORTA_DEBOUNCE, val_deb); > > spin_unlock_irqrestore(&gc->bgpio_lock, flags); > > -- > 2.25.1 >