Re: [RFC][PATCH] tree-wide: Remove __inline__ and __inline usage
From: Peter Zijlstra
Date: Tue Nov 06 2018 - 09:46:42 EST
On Tue, Nov 06, 2018 at 03:09:37PM +0100, Miguel Ojeda wrote:
> On Tue, Nov 6, 2018 at 11:02 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> >
> > allows adding the "inline" keyword to 'asm ("")' statements. The
> > problem is that we're possibly redefining "inline" to
> > "inline __attribute__((__always_inline__))" which makes the proposed:
> >
> > asm volatile inline ("")
> >
> > (...)
> >
> > -#define inline inline
> > -#define inline inline
> > -
>
> It seems somehow your patch got underscores removed.
If you actually read what I wrote:
> > Therefore I'm proposing to run:
> >
> > git grep -l "\<__inline\(\|__\)\>" | while read file
> > do
> > sed -i -e 's/\<__inline\(\|__\)\>/inline/g' $file
> > done
> >
> > On your current tree, and apply the below fixup patch on top of that
> > result.
It makes sense.
> By the way, we have been re#defining the inline keyword since (at
> least) 2003, and already in 2008 Ingo was commenting in a commit to
> add the #ifdef to avoid it for x86. Is it still a good idea nowadays
> that the minimum compiler is quite modern compare to a decade ago? Is
> it still needed on non-x86 arches (they don't have it in the
> defconfig)? Couldn't functions be marked as __always_inline if really
> needed (as many are)?
>
> By the way (x2): CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING is only ever
> referenced in that #ifdef. May it be removed?
Dunno, but that is a far more difficult patch. The proposed one is an
obvious identify.