]> git.baikalelectronics.ru Git - kernel.git/commit
smpboot: fix duplicate and misplaced inlining directive
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 25 Jul 2021 18:06:37 +0000 (11:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 25 Jul 2021 18:06:37 +0000 (11:06 -0700)
commite06d36e0107490c94778146526bbb9a7eadd176a
treeda9859c9a4c168edf8e09287b51122acba6b9d5c
parent9c6081898ad02a6b2dc8b07083f6d784cb793c6e
smpboot: fix duplicate and misplaced inlining directive

gcc doesn't care, but clang quite reasonably pointed out that the recent
commit 263948db641d ("smpboot: Mark idle_init() as __always_inlined to
work around aggressive compiler un-inlining") did some really odd
things:

    kernel/smpboot.c:50:20: warning: duplicate 'inline' declaration specifier [-Wduplicate-decl-specifier]
    static inline void __always_inline idle_init(unsigned int cpu)
                       ^

which not only has that duplicate inlining specifier, but the new
__always_inline was put in the wrong place of the function definition.

We put the storage class specifiers (ie things like "static" and
"extern") first, and the type information after that.  And while the
compiler may not care, we put the inline specifier before the types.

So it should be just

    static __always_inline void idle_init(unsigned int cpu)

instead.

Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/smpboot.c