Re: [RFC 05/31] x86/compiler: Tweak __UNIQUE_ID naming
From: Josh Poimboeuf
Date: Tue Sep 03 2024 - 22:01:48 EST
On Tue, Sep 03, 2024 at 09:56:34AM +0200, Peter Zijlstra wrote:
> > -#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
> > +/* Format: __UNIQUE_ID_<name>_<__COUNTER__> */
> > +#define __UNIQUE_ID(name) \
> > + __PASTE(__UNIQUE_ID_, \
> > + __PASTE(name, \
> > + __PASTE(_, __COUNTER__)))
>
> OK, that's just painful to read; how about so?
>
> __PASTE(__UNIQUE_ID_, \
> __PASTE(name, \
> __PASTE(_, __COUNTER)))
Sure.
> > /**
> > * data_race - mark an expression as containing intentional data races
> > @@ -218,7 +222,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
> > */
> > #define ___ADDRESSABLE(sym, __attrs) \
> > static void * __used __attrs \
> > - __UNIQUE_ID(__PASTE(__addressable_,sym)) = (void *)(uintptr_t)&sym;
> > + __UNIQUE_ID(__PASTE(addressable_, sym)) = (void *)(uintptr_t)&sym;
>
> This change doesn't get mention ?
Hm, I have no idea why I did that... I'll drop it.
--
Josh