Skip to content

Commit a1833a5

Browse files
committed
smpboot: fix duplicate and misplaced inlining directive
gcc doesn't care, but clang quite reasonably pointed out that the recent commit e9ba16e ("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 <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 3c0ce14 commit a1833a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/smpboot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void __init idle_thread_set_boot_cpu(void)
4747
*
4848
* Creates the thread if it does not exist.
4949
*/
50-
static inline void __always_inline idle_init(unsigned int cpu)
50+
static __always_inline void idle_init(unsigned int cpu)
5151
{
5252
struct task_struct *tsk = per_cpu(idle_threads, cpu);
5353

0 commit comments

Comments
 (0)