diff mbox series

[v1,1/2] gpio: dwapb: Get rid of unnecessary conjunction over 32-bit value

Message ID 20200422110654.23442-1-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/2] gpio: dwapb: Get rid of unnecessary conjunction over 32-bit value | expand

Commit Message

Andy Shevchenko April 22, 2020, 11:06 a.m. UTC
When we mask interrupts before sleep, there is no need to have a conjunction
with 0xffffffff since the accepted by dwapb_write() value is 32-bit.

Cc: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-dwapb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Serge Semin April 22, 2020, 4:28 p.m. UTC | #1
On Wed, Apr 22, 2020 at 02:06:53PM +0300, Andy Shevchenko wrote:
> When we mask interrupts before sleep, there is no need to have a conjunction
> with 0xffffffff since the accepted by dwapb_write() value is 32-bit.

Thanks!

Acked-by: Serge Semin <fancer.lancer@gmail.com>

> 
> Cc: Serge Semin <fancer.lancer@gmail.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/gpio-dwapb.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
> index 31d29ec6ab5c3..9d8476afaba3d 100644
> --- a/drivers/gpio/gpio-dwapb.c
> +++ b/drivers/gpio/gpio-dwapb.c
> @@ -743,8 +743,7 @@ static int dwapb_gpio_suspend(struct device *dev)
>  			ctx->int_deb	= dwapb_read(gpio, GPIO_PORTA_DEBOUNCE);
>  
>  			/* Mask out interrupts */
> -			dwapb_write(gpio, GPIO_INTMASK,
> -				    0xffffffff & ~ctx->wake_en);
> +			dwapb_write(gpio, GPIO_INTMASK, ~ctx->wake_en);
>  		}
>  	}
>  	spin_unlock_irqrestore(&gc->bgpio_lock, flags);
> -- 
> 2.26.1
>
Linus Walleij April 28, 2020, 12:53 p.m. UTC | #2
On Wed, Apr 22, 2020 at 1:06 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> When we mask interrupts before sleep, there is no need to have a conjunction
> with 0xffffffff since the accepted by dwapb_write() value is 32-bit.
>
> Cc: Serge Semin <fancer.lancer@gmail.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Both patches applied with Sergey's review tags, thanks!

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
index 31d29ec6ab5c3..9d8476afaba3d 100644
--- a/drivers/gpio/gpio-dwapb.c
+++ b/drivers/gpio/gpio-dwapb.c
@@ -743,8 +743,7 @@  static int dwapb_gpio_suspend(struct device *dev)
 			ctx->int_deb	= dwapb_read(gpio, GPIO_PORTA_DEBOUNCE);
 
 			/* Mask out interrupts */
-			dwapb_write(gpio, GPIO_INTMASK,
-				    0xffffffff & ~ctx->wake_en);
+			dwapb_write(gpio, GPIO_INTMASK, ~ctx->wake_en);
 		}
 	}
 	spin_unlock_irqrestore(&gc->bgpio_lock, flags);