[PATCH v2 4/9] arm64/sysreg: Provide a helper macro for defining sysreg bitmasks

Mark Brown broonie at kernel.org
Wed Mar 23 12:15:54 PDT 2022


On Wed, Mar 23, 2022 at 05:58:25PM +0000, Mark Rutland wrote:
> On Wed, Mar 16, 2022 at 05:08:44PM +0000, Mark Brown wrote:

> > Ideally this should be provided along with the generic BIT() macros however
> > there are a bunch of existing places with such macros including some that
> > actually call their macro BITMASK() so rather than create a dependency on
> > a wider cleanup let's define something local for now, this can be improved
> > later. This also sidesteps the need to consider types other than u64.

> In <linux/bits.h> we have GENMASK() and GENMASK_ULL() for this. Is there
> a problem using those?

> I think I got confused as to the name in the original version of the
> scripting patch, and used BITMASK() by accident rather than by design,
> but I could be mistaken.

They should do the trick, yes - I was *sure* there was something but
couldn't find it when I was searching around since I was looking for
some variation on a name with BIT in it and obviously the above doesn't
match.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20220323/41573b34/attachment.sig>


More information about the linux-arm-kernel mailing list