From: Peter Zijlstra <peterz@infradead.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linux List Kernel Mailing <linux-kernel@vger.kernel.org>,
bp@alien8.de, namit@vmware.com, joe@perches.com,
Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
segher@kernel.crashing.org, Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RFC][PATCH] tree-wide: Remove __inline__ and __inline usage
Date: Tue, 6 Nov 2018 20:41:49 +0100 [thread overview]
Message-ID: <20181106194149.GC9761@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CAHk-=wjFL-4p-4FrJbtKADXRaBPK_Pi_-BSSqm_j784Mq6aHjQ@mail.gmail.com>
On Tue, Nov 06, 2018 at 11:18:59AM -0800, Linus Torvalds wrote:
> On Tue, Nov 6, 2018 at 2:02 AM Peter Zijlstra <peterz@infradead.org> 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.
>
> So I started doing this, and in fact fixed up a few more issues by
> hand on top of your patch, but then realized hat it's somewhat
> dangerous and possibly broken.
>
> For the uapi header files in particular, __inline__ may actually be
> required. Depending on use, and compiler settings, "inline" can be a
> word reserved for the user, and shouldn't be used by system headers.
*groan*, indeed. Now obvious those headers need to compile without our
override, so we could simply exclude uapi from the transformation.
(and __inline is mostly in staging/ and a few stray places, we really
should get rid of that one I feel, there's so few of them)
> But we *could* get rid of these two lines in include/linux/compiler_types.h
>
> #define __inline__ inline
> #define __inline inline
>
> and just say that "inline" for the kernel means "always_inline", but
> if you use __inline__ or __inline then you get the "raw" compiler
> inlining.
>
> Then people can decide to get rid of __inline__ on a case-by-case basis.
Right, that gets us what we need; but makes a fair bunch of kernel code
compile differently.
It probably doesn't matter, and a fair amount of the __inline__ usage is
in fairly crusty code which will likely never get fixed up.
And that is probably still a safer option than removing the #define
inline entirely.
Do you want me to do that patch, or have you already just done it?
next prev parent reply other threads:[~2018-11-06 19:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-06 10:02 Peter Zijlstra
2018-11-06 14:09 ` Miguel Ojeda
2018-11-06 14:46 ` Peter Zijlstra
2018-11-06 17:21 ` Miguel Ojeda
2018-11-06 19:18 ` Linus Torvalds
2018-11-06 19:41 ` Peter Zijlstra [this message]
2018-11-06 19:51 ` Linus Torvalds
2018-11-06 19:59 ` Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181106194149.GC9761@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bp@alien8.de \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=mingo@kernel.org \
--cc=namit@vmware.com \
--cc=segher@kernel.crashing.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®