[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251126221718.6c595c57@pumpkin>
Date: Wed, 26 Nov 2025 22:17:18 +0000
From: david laight <david.laight@...box.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Rasmus Villemoes <ravi@...vas.dk>, "Yury Norov (NVIDIA)"
<yury.norov@...il.com>, Linus Walleij <linus.walleij@...aro.org>, Nicolas
Frattaroli <nicolas.frattaroli@...labora.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 00/21] lib: add alternatives for GENMASK()
On Wed, 26 Nov 2025 11:44:59 -0800
Linus Torvalds <torvalds@...ux-foundation.org> wrote:
> On Wed, 26 Nov 2025 at 01:07, Rasmus Villemoes <ravi@...vas.dk> wrote:
> >
> > There is, however, an alternative that resembles the syntax in data
> > sheets even more closely:
> >
> > #define BITS(low_high) GENMASK((0 ? low_high), (1 ? low_high))
>
> Oh, me likey. That's a much better idea than my crazy syntax.
Mark B. will accuse you of abusing ?: :-)
I've just looked at a .i file.
GENMASK() currently expands to 855 chars plus four copies of each argument.
Both FIELD_PREP/GET(GENMASK(), v) are about 18k plus three copies of v.
FIELD_GET(mask,v) has 18 expansions of 'mask'.
HWEIHT32(GENMASK(15,0)) is about 30k - don't ask why anyone would do it.
They all look excessive.
David
Powered by blists - more mailing lists