[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220528111122.1888581-1-zouyue3@huawei.com>
Date: Sat, 28 May 2022 11:11:22 +0000
From: Yue Zou <zouyue3@...wei.com>
To: <sfr@...b.auug.org.au>, <akpm@...ux-foundation.org>,
<mhiramat@...nel.org>, <rostedt@...dmis.org>,
<ahalaney@...hat.com>, <vbabka@...e.cz>, <Jason@...c4.com>,
<mark-pk.tsai@...iatek.com>, <linux-kernel@...r.kernel.org>
Subject: [PATCH -next] smp: Move stub from main.c into smp.h
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@...wei.com>
Signed-off-by: Yue Zou <zouyue3@...wei.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
Powered by blists - more mailing lists