Re: [PATCH] unroll: Make unrolled, unrolled_full and unrolled_none function-like

From: David Laight

Date: Thu Oct 22 2026 - 05:06:20 EST


On Wed, 21 Oct 2026 17:02:30 +0200
Alexander Lobakin <aleksander.lobakin@xxxxxxxxx> wrote:

> From: Tzu-Ching Yang <shingekinocore@xxxxxxxxx>
> Date: Fri, 16 Oct 2026 10:56:13 +0800
>
> > unrolled, unrolled_full and unrolled_none are object-like macros with
>
> Because those are attributes. With function-like names such patterns:
>
> unrolled()
> for (int i = 0; i < n; i++)
>
> are counter-intuitive and confusing.

Is it possible to make the syntax:
unrolled_for(....)

Or is that made 'all hard and difficult' because he setting is sticky?

David

>
> We have either plain-named attributes like `notrace` (BTW what if you
> name your variable as `notrace`?) or underscored like `__always_inline`.
> If you really need to name your variables `unrolled`, then I'd expect
> changing these macros to `__unrolled` etc, not to `unrolled()`.
> Although I'm not sure we really need it, there's tons of such macros in
> the kernel -- try naming your variable `current`.
>
> > lower-case names, so in a file that includes <linux/unroll.h> every
> > later identifier with one of these names is replaced with a _Pragma()
> > operator. A local variable or struct member with one of these names
> Thanks,
> Olek
>