public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] smp: Move stub from main.c into smp.h
@ 2022-05-28 11:11 Yue Zou
  2022-05-28 12:26 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yue Zou @ 2022-05-28 11:11 UTC (permalink / raw)
  To: sfr, akpm, mhiramat, rostedt, ahalaney, vbabka, Jason,
	mark-pk.tsai, linux-kernel

Move the stubs in init/main.c for !CONFIG_SMP to smp.h
since these definitions for CONFIG_SMP are in smp.h already.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yue Zou <zouyue3@huawei.com>
---
 include/linux/smp.h | 4 ++++
 init/main.c         | 5 -----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/include/linux/smp.h b/include/linux/smp.h
index a80ab58ae3f1..bc42f6f8415a 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -183,6 +183,10 @@ static inline int get_boot_cpu_id(void)
 
 #else /* !SMP */
 
+static const unsigned int setup_max_cpus = NR_CPUS;
+static inline void setup_nr_cpu_ids(void) { }
+static inline void smp_prepare_cpus(unsigned int maxcpus) { }
+
 static inline void smp_send_stop(void) { }
 
 /*
diff --git a/init/main.c b/init/main.c
index 0f452ae3b20f..3c432b28c78f 100644
--- a/init/main.c
+++ b/init/main.c
@@ -602,11 +602,6 @@ static int __init rdinit_setup(char *str)
 }
 __setup("rdinit=", rdinit_setup);
 
-#ifndef CONFIG_SMP
-static const unsigned int setup_max_cpus = NR_CPUS;
-static inline void setup_nr_cpu_ids(void) { }
-static inline void smp_prepare_cpus(unsigned int maxcpus) { }
-#endif
 
 /*
  * We need to store the untouched command line for future reference.
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-06-02 18:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-28 11:11 [PATCH -next] smp: Move stub from main.c into smp.h Yue Zou
2022-05-28 12:26 ` kernel test robot
2022-05-28 12:57 ` kernel test robot
2022-06-02 18:58 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox