From nobody Thu May 7 13:12:16 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B092C433F5 for ; Sat, 28 May 2022 10:50:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355816AbiE1KuX (ORCPT ); Sat, 28 May 2022 06:50:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234108AbiE1Kt7 (ORCPT ); Sat, 28 May 2022 06:49:59 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F415113D66 for ; Sat, 28 May 2022 03:49:57 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4L9JLF5Zd1z1JC5R; Sat, 28 May 2022 18:48:21 +0800 (CST) Received: from dggpemm500018.china.huawei.com (7.185.36.111) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 28 May 2022 18:49:56 +0800 Received: from huawei.com (10.175.112.125) by dggpemm500018.china.huawei.com (7.185.36.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 28 May 2022 18:49:55 +0800 From: Yue Zou To: , , , , , , , , Subject: [PATCH -next] smp: Move stub from main.c into smp.h Date: Sat, 28 May 2022 11:11:22 +0000 Message-ID: <20220528111122.1888581-1-zouyue3@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500018.china.huawei.com (7.185.36.111) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Signed-off-by: Yue Zou Reported-by: kernel test robot --- 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) =20 #else /* !SMP */ =20 +static const unsigned int setup_max_cpus =3D 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) { } =20 /* 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=3D", rdinit_setup); =20 -#ifndef CONFIG_SMP -static const unsigned int setup_max_cpus =3D NR_CPUS; -static inline void setup_nr_cpu_ids(void) { } -static inline void smp_prepare_cpus(unsigned int maxcpus) { } -#endif =20 /* * We need to store the untouched command line for future reference. --=20 2.25.1