Skip to content

Commit 28ba057

Browse files
andy-shevbrgl
authored andcommitted
gpio: 74xx-mmio: use bits.h macros for all masks
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> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
1 parent d3054ba commit 28ba057

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/gpio/gpio-74xx-mmio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru>
66
*/
77

8+
#include <linux/bits.h>
89
#include <linux/err.h>
910
#include <linux/gpio/driver.h>
1011
#include <linux/mod_devicetable.h>
@@ -14,7 +15,7 @@
1415

1516
#define MMIO_74XX_DIR_IN (0 << 8)
1617
#define MMIO_74XX_DIR_OUT (1 << 8)
17-
#define MMIO_74XX_BIT_CNT(x) ((x) & 0xff)
18+
#define MMIO_74XX_BIT_CNT(x) ((x) & GENMASK(7, 0))
1819

1920
struct mmio_74xx_gpio_priv {
2021
struct gpio_chip gc;

0 commit comments

Comments
 (0)