linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<x86@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>, Nadav Amit <namit@vmware.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Subject: Re: [PATCH v2 3/6] compiler_types.h: don't #define __inline
Date: Wed, 4 Sep 2019 17:13:53 -0700	[thread overview]
Message-ID: <CAKwvOdn2zbRCL+L92zjjuyhj4NLLtOEWd3pjady9KyYb7PAbmw@mail.gmail.com> (raw)
In-Reply-To: <20190830231527.22304-4-linux@rasmusvillemoes.dk>

On Fri, Aug 30, 2019 at 4:15 PM Rasmus Villemoes
<linux@rasmusvillemoes.dk> wrote:
>
> The spellings __inline and __inline__ should be reserved for uses
> where one really wants to refer to the inline keyword, regardless of
> whether or not the spelling "inline" has been #defined to something
> else. Due to use of __inline__ in uapi headers, we can't easily get
> rid of the definition of __inline__. However, almost all users of
> __inline has been converted to inline, so we can get rid of that
> #define.

Besides patch 1 and 2 of this series, I also see:
Documentation/trace/tracepoint-analysis.rst
318:         :      extern __inline void
__attribute__((__gnu_inline__, __always_inline__, _

scripts/kernel-doc
1574:    $prototype =~ s/^__inline +//;

>
> The exception is include/acpi/platform/acintel.h. However, that header
> is only included when using the intel compiler (does anybody actually
> build the kernel with that?), and the ACPI_INLINE macro is only used

In my effort to make the kernel slightly more compiler-portable, I
have not yet found anyone building with ICC.  I would love to be
proven wrong.  Let me go ask some of my Intel friends.

> in the definition of utterly trivial stub functions, where I doubt a

See:
include/acpi/platform/acenv.h
146 #elif defined(__INTEL_COMPILER)
147 #include <acpi/platform/acintel.h>

> small change of semantics (lack of __gnu_inline) changes anything.

include/acpi/platform/acintel.h
25:#define ACPI_INLINE                 __inline
include/acpi/platform/acgcc.h
29:#define ACPI_INLINE             __inline__

lol wut

I mean, you just would have to change that one line in
include/acpi/platform/acintel.h, right?  I'd sign off on this patch
with such a patch added to the series.

>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
>  include/linux/compiler_types.h | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
> index 599c27b56c29..ee49be6d6088 100644
> --- a/include/linux/compiler_types.h
> +++ b/include/linux/compiler_types.h
> @@ -150,8 +150,17 @@ struct ftrace_likely_data {
>         __maybe_unused notrace
>  #endif
>
> +/*
> + * gcc provides both __inline__ and __inline as alternate spellings of
> + * the inline keyword, though the latter is undocumented. New kernel
> + * code should only use the inline spelling, but some existing code
> + * uses __inline__. Since we #define inline above, to ensure
> + * __inline__ has the same semantics, we need this #define.
> + *
> + * However, the spelling __inline is strictly reserved for referring
> + * to the bare keyword.
> + */
>  #define __inline__ inline
> -#define __inline   inline
>
>  /*
>   * Rather then using noinline to prevent stack consumption, use
> --
> 2.20.1
>


-- 
Thanks,
~Nick Desaulniers

  reply	other threads:[~2019-09-05  0:14 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-29  8:32 [RFC PATCH 0/5] make use of gcc 9's "asm inline()" Rasmus Villemoes
2019-08-29  8:32 ` [RFC PATCH 1/5] treewide: replace __inline__ by inline Rasmus Villemoes
2019-08-29 16:29   ` Joe Perches
2019-08-29  8:32 ` [RFC PATCH 2/5] compiler_types.h: don't #define __inline__ Rasmus Villemoes
2019-08-29  8:32 ` [RFC PATCH 3/5] compiler-gcc.h: add asm_inline definition Rasmus Villemoes
2019-08-29  8:32 ` [RFC PATCH 4/5] x86: alternative.h: use asm_inline for all alternative variants Rasmus Villemoes
2019-08-29  8:32 ` [RFC PATCH 5/5] x86: bug.h: use asm_inline in _BUG_FLAGS definitions Rasmus Villemoes
2019-08-29 16:05 ` [RFC PATCH 0/5] make use of gcc 9's "asm inline()" Linus Torvalds
2019-08-30  7:45   ` Rasmus Villemoes
2019-08-29 17:36 ` Nick Desaulniers
2019-08-29 18:15   ` Linus Torvalds
2019-08-29 18:26     ` Nadav Amit
2019-08-29 18:42     ` Borislav Petkov
2019-08-29 19:41   ` Masahiro Yamada
2019-08-30 23:15 ` [PATCH v2 0/6] " Rasmus Villemoes
2019-08-30 23:15   ` [PATCH v2 1/6] staging: rtl8723bs: replace __inline by inline Rasmus Villemoes
2019-09-04 23:54     ` Nick Desaulniers
2019-08-30 23:15   ` [PATCH v2 2/6] lib/zstd/mem.h: " Rasmus Villemoes
2019-09-04 23:59     ` Nick Desaulniers
2019-09-05  0:07       ` Miguel Ojeda
2019-09-05  9:28         ` Rasmus Villemoes
2019-08-30 23:15   ` [PATCH v2 3/6] compiler_types.h: don't #define __inline Rasmus Villemoes
2019-09-05  0:13     ` Nick Desaulniers [this message]
2019-09-05  9:45       ` Rasmus Villemoes
2019-08-30 23:15   ` [PATCH v2 4/6] compiler-gcc.h: add asm_inline definition Rasmus Villemoes
2019-09-05  0:18     ` Nick Desaulniers
2019-09-05  5:43       ` Nadav Amit
2019-09-05 11:07       ` Rasmus Villemoes
2019-09-05 13:45         ` Segher Boessenkool
2019-09-05 14:23           ` Rasmus Villemoes
2019-09-05 14:47             ` Segher Boessenkool
2019-09-05 15:52           ` Miguel Ojeda
2019-09-05 16:13             ` Miguel Ojeda
2019-09-06 12:23             ` Segher Boessenkool
2019-09-06 15:13               ` Miguel Ojeda
2019-09-06 16:30                 ` Segher Boessenkool
2019-09-06 16:39                   ` Jakub Jelinek
2019-09-06 18:14                     ` Nick Desaulniers
2019-09-06 22:03                       ` Segher Boessenkool
2019-09-06 22:35                         ` Nick Desaulniers
2019-09-06 22:56                           ` Segher Boessenkool
2019-09-06 23:42                             ` Nick Desaulniers
2019-09-07  0:14                               ` Segher Boessenkool
2019-09-07  1:04                                 ` Nick Desaulniers
2019-09-07 13:11                                   ` Segher Boessenkool
2019-09-08 13:55                                     ` Miguel Ojeda
2019-09-12 21:54                                     ` Nick Desaulniers
2019-09-12 22:12                                       ` Rasmus Villemoes
2019-09-20  0:50                                       ` Segher Boessenkool
2019-09-06 16:47                   ` Miguel Ojeda
2019-08-30 23:15   ` [PATCH v2 5/6] x86: alternative.h: use asm_inline for all alternative variants Rasmus Villemoes
2019-08-30 23:15   ` [PATCH v2 6/6] x86: bug.h: use asm_inline in _BUG_FLAGS definitions Rasmus Villemoes
2019-09-12 22:19   ` [PATCH v3 0/6] make use of gcc 9's "asm inline()" Rasmus Villemoes
2019-09-12 22:19     ` [PATCH v3 1/6] staging: rtl8723bs: replace __inline by inline Rasmus Villemoes
2019-09-29 10:40       ` Greg Kroah-Hartman
2019-09-12 22:19     ` [PATCH v3 2/6] lib/zstd/mem.h: " Rasmus Villemoes
2019-09-12 22:19     ` [PATCH v3 3/6] compiler_types.h: don't #define __inline Rasmus Villemoes
2019-09-12 22:19     ` [PATCH v3 4/6] compiler-types.h: add asm_inline definition Rasmus Villemoes
2019-09-12 22:19     ` [PATCH v3 5/6] x86: alternative.h: use asm_inline for all alternative variants Rasmus Villemoes
2019-09-13  5:41       ` Ingo Molnar
2019-09-12 22:19     ` [PATCH v3 6/6] x86: bug.h: use asm_inline in _BUG_FLAGS definitions Rasmus Villemoes
2019-09-13  5:42       ` Ingo Molnar
2019-09-12 22:30     ` [PATCH v3 0/6] make use of gcc 9's "asm inline()" Miguel Ojeda
2019-09-13  6:11       ` Rasmus Villemoes
2019-09-13 15:21         ` Greg Kroah-Hartman
2019-09-15 18:20           ` Miguel Ojeda

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=CAKwvOdn2zbRCL+L92zjjuyhj4NLLtOEWd3pjady9KyYb7PAbmw@mail.gmail.com \
    --to=ndesaulniers@google.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=mingo@redhat.com \
    --cc=namit@vmware.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).