Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: 74xx-mmio: Use bits instead of plain numbers for flags

The initial code was misleading to use bitwise AND against plain number,
and the commit d3054ba1db62 ("gpio: 74xx-mmio: Check MMIO_74XX_DIR_IN flag
in mmio_74xx_dir_in()") missed that. Switch definitions to be defined bits
for the correct comparison.

Fixes: d3054ba1db62 ("gpio: 74xx-mmio: Check MMIO_74XX_DIR_IN flag in mmio_74xx_dir_in()")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>

authored by

Andy Shevchenko and committed by
Bartosz Golaszewski
e3c1d6c8 f2a2f2c9

+2 -2
+2 -2
drivers/gpio/gpio-74xx-mmio.c
··· 13 13 #include <linux/platform_device.h> 14 14 #include <linux/property.h> 15 15 16 - #define MMIO_74XX_DIR_IN (0 << 8) 17 - #define MMIO_74XX_DIR_OUT (1 << 8) 16 + #define MMIO_74XX_DIR_IN BIT(8) 17 + #define MMIO_74XX_DIR_OUT BIT(9) 18 18 #define MMIO_74XX_BIT_CNT(x) ((x) & GENMASK(7, 0)) 19 19 20 20 struct mmio_74xx_gpio_priv {