[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMRc=MepfRwCvkos5yqQMHk0m=yXXqSv3O+nYWW0x6MuKE=t4Q@mail.gmail.com>
Date: Thu, 28 Jul 2022 15:48:17 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCH v1 1/1] gpio: 74xx-mmio: Use bits instead of plain numbers
for flags
On Tue, Jul 26, 2022 at 11:14 AM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> 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@...cle.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> drivers/gpio/gpio-74xx-mmio.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-74xx-mmio.c b/drivers/gpio/gpio-74xx-mmio.c
> index cd399898ed12..0464f1ecd20d 100644
> --- a/drivers/gpio/gpio-74xx-mmio.c
> +++ b/drivers/gpio/gpio-74xx-mmio.c
> @@ -13,8 +13,8 @@
> #include <linux/platform_device.h>
> #include <linux/property.h>
>
> -#define MMIO_74XX_DIR_IN (0 << 8)
> -#define MMIO_74XX_DIR_OUT (1 << 8)
> +#define MMIO_74XX_DIR_IN BIT(8)
> +#define MMIO_74XX_DIR_OUT BIT(9)
> #define MMIO_74XX_BIT_CNT(x) ((x) & GENMASK(7, 0))
>
> struct mmio_74xx_gpio_priv {
> --
> 2.35.1
>
Applied, thanks!
Bart
Powered by blists - more mailing lists