Re: [RFC PATCH 1/2] bits: introduce ffs_val()

From: Arnd Bergmann

Date: Fri Jan 09 2026 - 13:50:58 EST


On Fri, Jan 9, 2026, at 18:46, Petr Tesarik wrote:
> On Fri, 9 Jan 2026 12:16:06 -0500 Yury Norov <ynorov@xxxxxxxxxx> wrote:
>> > diff --git a/MAINTAINERS b/MAINTAINERS
>> > index a0dd762f5648b..8f15c76a67ea2 100644
>> > --- a/MAINTAINERS
>> > +++ b/MAINTAINERS
>> > @@ -4466,6 +4466,7 @@ F: arch/*/lib/bitops.c
>> > F: include/asm-generic/bitops
>> > F: include/asm-generic/bitops.h
>> > F: include/linux/bitops.h
>> > +F: include/linux/ffs_val.h
>>
>> No need for a separate header. Just put int straight in bitops.h.
>
> Well, <linux/bitops.h> is a bit heavy, so I was afraid of spoiling
> build times if I include it from <asm-generic/div64.h>, but if you say
> it's fine, yes, why not, let's put it into bitops.h somewhere before
> #include <asm/bitops.h>.

A single macro definition makes zero difference for build times.

What makes linux/bitops.h expensive is the 419kb of preprocessed
source code that result from the generated atomics in asm/bitops.h
that get included everywhere.

Arnd