smp: make __smp_processor_id() 0-argument macro
authorAlexey Dobriyan <adobriyan@gmail.com>
Mon, 5 Feb 2024 09:39:30 +0000 (12:39 +0300)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 22 Feb 2024 23:38:55 +0000 (15:38 -0800)
smp_processor_id family of macros never accepted any arguments.

#define __smp_processor_id(x)

works by accident (see C99 6.10.3 ยง4). __smp_processor_id() gets
1 (empty) argument and passes it down to raw_smp_processor_id()
which doesn't accept arguments.

Link: https://lkml.kernel.org/r/0037d1f2-8153-4b33-b43e-f4b6ecd710ac@p183
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/smp.h

index e87520dc2959dd9bd047ed2740945fd20bf7fd9a..cc517002c599319f1214a740fdc8f7ae69b64cf6 100644 (file)
@@ -261,7 +261,7 @@ static inline int get_boot_cpu_id(void)
  * regular asm read for the stable.
  */
 #ifndef __smp_processor_id
-#define __smp_processor_id(x) raw_smp_processor_id(x)
+#define __smp_processor_id() raw_smp_processor_id()
 #endif
 
 #ifdef CONFIG_DEBUG_PREEMPT