Re: [PATCH v3 1/2] gpio: tps65219: add GPIO support for TPS65219 PMIC

From: Andy Shevchenko
Date: Mon May 29 2023 - 14:18:15 EST


On Mon, May 29, 2023 at 6:21 PM jerome Neanne <jneanne@xxxxxxxxxxxx> wrote:
> On 26/05/2023 20:15, andy.shevchenko@xxxxxxxxx wrote:

...

> > Missing bits.h
> >
>
> Thanks for your review.Just to be sure on this particular point:
> Your recommendation here it to include explicitly bits.h.
>
> I can see BIT_MASK(n) defined in linux/bits.h
> BIT(n) is defined in vdso/bits.h
> From what I can see, BIT(n) is broadly used across kernel but
> BIT_MASK(n) sounds to be the Linux strict way...
>
> In current version I'm using BIT(n) macro not BIT_MASK(n).
> Do you recommend to replace every BIT(n) currently used with BIT_MASK(n)?

The semantics (if you look into implementations of those two) are different.

BIT() is for a single word (your case), while BIT_MASK() is for an
array of words.

* word in case of Linux kernel means element of unsigned long type.

> Sorry for asking dumb questions. Just trying to make sure I
> correctly/fully understand your feedback... And do it all right for the
> next iteration.

No problem.

--
With Best Regards,
Andy Shevchenko