diff mbox series

[v1,3/3] gpio: 74xx-mmio: use bits.h macros for all masks

Message ID 20220718220252.16923-3-andriy.shevchenko@linux.intel.com
State Accepted
Commit 28ba057456412794198ba6c953aa2042147c2de5
Headers show
Series [v1,1/3] gpio: 74xx-mmio: Make use of device properties | expand

Commit Message

Andy Shevchenko July 18, 2022, 10:02 p.m. UTC
Make use of the GENMASK() (far less error-prone, far more concise).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpio-74xx-mmio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Linus Walleij July 18, 2022, 10:47 p.m. UTC | #1
On Tue, Jul 19, 2022 at 12:02 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> Make use of the GENMASK() (far less error-prone, far more concise).
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-74xx-mmio.c b/drivers/gpio/gpio-74xx-mmio.c
index b2cc8a55c257..cd399898ed12 100644
--- a/drivers/gpio/gpio-74xx-mmio.c
+++ b/drivers/gpio/gpio-74xx-mmio.c
@@ -5,6 +5,7 @@ 
  *  Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru>
  */
 
+#include <linux/bits.h>
 #include <linux/err.h>
 #include <linux/gpio/driver.h>
 #include <linux/mod_devicetable.h>
@@ -14,7 +15,7 @@ 
 
 #define MMIO_74XX_DIR_IN	(0 << 8)
 #define MMIO_74XX_DIR_OUT	(1 << 8)
-#define MMIO_74XX_BIT_CNT(x)	((x) & 0xff)
+#define MMIO_74XX_BIT_CNT(x)	((x) & GENMASK(7, 0))
 
 struct mmio_74xx_gpio_priv {
 	struct gpio_chip	gc;