[PATCH] sched/smp: Fix redefinition of flush_smp_call_function_queue()
From: Jony Lynn
Date: Mon May 26 2025 - 12:09:45 EST
The header file kernel/sched/smp.h currently defines
flush_smp_call_function_queue() unconditionally in the #else branch,
but lacks appropriate header guards, which causes multiple inclusion
and a redefinition error during compilation.
This patch adds a proper header guard to prevent multiple inclusion of
kernel/sched/smp.h and thus avoid the redefinition of
flush_smp_call_function_queue() when included multiple times in
different compilation units.
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202505262213.QsOaQU24-lkp@xxxxxxxxx/
Signed-off-by: Jony Lynn <1198715581lxf@xxxxxxxxx>
---
kernel/sched/smp.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kernel/sched/smp.h b/kernel/sched/smp.h
index 21ac44428bb0..8f1483b79e60 100644
--- a/kernel/sched/smp.h
+++ b/kernel/sched/smp.h
@@ -4,6 +4,9 @@
* and other internal parts of the core kernel:
*/
+#ifndef _KERNEL_SCHED_SMP_H
+#define _KERNEL_SCHED_SMP_H
+
extern void sched_ttwu_pending(void *arg);
extern bool call_function_single_prep_ipi(int cpu);
@@ -13,3 +16,5 @@ extern void flush_smp_call_function_queue(void);
#else
static inline void flush_smp_call_function_queue(void) { }
#endif
+
+#endif
--
2.43.0