From: Joe Perches <joe@perches.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
x86@kernel.org, linux-kernel@vger.kernel.org
Cc: 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>,
ndesaulniers@google.com
Subject: Re: [RFC PATCH 1/5] treewide: replace __inline__ by inline
Date: Thu, 29 Aug 2019 09:29:23 -0700 [thread overview]
Message-ID: <4232843e9fe0444c1c975ac6be4cb81a67f9f6ef.camel@perches.com> (raw)
In-Reply-To: <20190829083233.24162-2-linux@rasmusvillemoes.dk>
On Thu, 2019-08-29 at 10:32 +0200, Rasmus Villemoes wrote:
> Currently, compiler_types.h #defines __inline__ as inline. However,
> that defeats the purpose of gcc providing __inline__ as an alternate
> spelling of that keyword - namely, that it is always accessible under
> that name, even if one chooses to #define inline, which we also do in
> order to attach attribute(gnu_inline), and sometimes imply
> attribute(always_inline), etc.
>
> Note that it is quite possible that some header file defines a static
> inline function before the include chain has reached compiler_types.h,
> but in that case both the existing __inline__ as well as the new
> inline spelling refer to gcc's keyword, and the redefinitions in
> compiler_types.h have no effect anyway.
>
> For those static inline definitions that appear after compiler_types.h
> has been processed, this is obviously a no-op due to the #define
> __inline__ inline.
>
> We will need to be able to use the __inline__ keyword to make use of
> the "asm inline()" feature from gcc 9. This is preparation for
> removing the #define.
>
> Generated by
>
> git grep --files-with-matches -w __inline__ | \
> grep -vE '^(usr|Documentation|scripts)/' | \
> grep -v /uapi/ | \
> xargs sed -i -e 's/static *__inline__/static inline/'
bikeshed: Perhaps better to use
xargs sed -i -e 's/\b__inline__\b/inline/g'
As static and __inline__ do not have to be on the same line.
for instance: (and I didn't look thoroughly)
This misses one of the uses of __static__ in
drivers/scsi/qla2xx/qla_os.c
The patch has:
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
[]
> @@ -342,7 +342,7 @@ qla2x00_restart_timer(scsi_qla_host_t *vha, unsigned long interval)
> mod_timer(&vha->timer, jiffies + interval * HZ);
> }
>
> -static __inline__ void
> +static inline void
> qla2x00_stop_timer(scsi_qla_host_t *vha)
> {
> del_timer_sync(&vha->timer);
But the code is:
drivers/scsi/qla2xxx/qla_os.c-318-/* TODO Convert to inlines
drivers/scsi/qla2xxx/qla_os.c-319- *
drivers/scsi/qla2xxx/qla_os.c-320- * Timer routines
drivers/scsi/qla2xxx/qla_os.c-321- */
drivers/scsi/qla2xxx/qla_os.c-322-
drivers/scsi/qla2xxx/qla_os.c:323:__inline__ void
drivers/scsi/qla2xxx/qla_os.c-324-qla2x00_start_timer(scsi_qla_host_t *vha, unsigned long interval)
drivers/scsi/qla2xxx/qla_os.c-325-{
drivers/scsi/qla2xxx/qla_os.c-326- timer_setup(&vha->timer, qla2x00_timer, 0);
drivers/scsi/qla2xxx/qla_os.c-327- vha->timer.expires = jiffies + interval * HZ;
drivers/scsi/qla2xxx/qla_os.c-328- add_timer(&vha->timer);
--
drivers/scsi/qla2xxx/qla_os.c-340- }
drivers/scsi/qla2xxx/qla_os.c-341-
drivers/scsi/qla2xxx/qla_os.c-342- mod_timer(&vha->timer, jiffies + interval * HZ);
drivers/scsi/qla2xxx/qla_os.c-343-}
drivers/scsi/qla2xxx/qla_os.c-344-
drivers/scsi/qla2xxx/qla_os.c:345:static __inline__ void
drivers/scsi/qla2xxx/qla_os.c-346-qla2x00_stop_timer(scsi_qla_host_t *vha)
drivers/scsi/qla2xxx/qla_os.c-347-{
drivers/scsi/qla2xxx/qla_os.c-348- del_timer_sync(&vha->timer);
drivers/scsi/qla2xxx/qla_os.c-349- vha->timer_active = 0;
drivers/scsi/qla2xxx/qla_os.c-350-}
The possible impacted files using 's/\b__inline__\b/inline/'
$ git grep -w '__inline__' -- '*.[ch]' | grep -vP 'static\s+__inline__'
(only hand selected matches)
arch/alpha/include/asm/compiler.h:#undef __inline__
arch/alpha/include/asm/floppy.h:__inline__ void virtual_dma_init(void)
arch/ia64/hp/common/sba_iommu.c:#define SBA_INLINE __inline__
drivers/parisc/sba_iommu.c:#define SBA_INLINE __inline__
drivers/scsi/qla2xxx/qla_os.c:__inline__ void
drivers/video/fbdev/intelfb/intelfbdrv.c:__inline__ int intelfb_var_to_depth(const struct fb_var_screeninfo *var)
next prev parent reply other threads:[~2019-08-29 16:29 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 [this message]
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
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=4232843e9fe0444c1c975ac6be4cb81a67f9f6ef.camel@perches.com \
--to=joe@perches.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=ndesaulniers@google.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
all inboxes | Powered by JetHome®