Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp1075732rdb; Fri, 20 Oct 2023 07:51:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+InkZbbD6Kux4o40Yofr/wAAlaHUDDZBvfvcMGULvdDMEn5n6oHmzPeX3x+CtyiYrNCyO X-Received: by 2002:a17:90a:d443:b0:27c:f309:f381 with SMTP id cz3-20020a17090ad44300b0027cf309f381mr2118061pjb.6.1697813474680; Fri, 20 Oct 2023 07:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697813474; cv=none; d=google.com; s=arc-20160816; b=XbQkY2rl18jblpZntSAUPlpCFjTK+T2ZFRkoyVk1cQdhgfYXw7B+0Is46PW+GdqA7+ o14r/dirAXp5jz4rVTs1HddgbvsGLTWGAfMJLnPgY1iZR7GHu00TTQPkDOQihdOH6QxL EnaADh9Rs1zoLz31U5cCAnYVQU3rls7mmkOi9Cb4xWvuwrdpC+Jlgsf9v9ov6nkAHigv xzON06evBOsoFEjI3APZgZNrL/xRK46hqBA5PQQzUyhP0WsR7R3TBEO+t0ia/KwMfyjR Lq1jpp78IHIrWCGVSNqUnsUTd5k3VNhMNaRabHhcPn03sQ33Tf5yVki+WxuIMo0kGvhk FygQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=Unz+VPGmRZLmLsfVX4v9XZp9es1MNtX9h7G4II8Puyc=; fh=WGlg/L+8YeGWvu6cSf91wZPMohaQRt105pRqSdEVdvo=; b=i61l2azH5iIg4sn5sMaVJbwR8Soa+ARZ4JWXBXDtJr2nlQMno4pxVKKuTmZjnE8eLk bUKW9n3F4YzmeNPwD9mubOyALVDwpurxZqw4Jkd5Gel4M1dfh5vd2Eo3pFeJsh3z2O5x 7Pgh1e/pQu1/Y4OFLAZreyJx8OVvL/2iQ9uV7porWD9lFfq8d9qqvdbuBb7ro/0KtJOX ApgzHXyUZgdN6WEbg4fTrpx/7aQh6yBJ+FBL60WyVtxeYlfK5hfwNBSeWQldXFMWYgVc BCnSP4OI76hXdKhCVMZxG7eEL3Tbhlmy+q5soPFIxNxUePzoG7MFEFzm0RAqgq0AQ1a3 JX/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id mw10-20020a17090b4d0a00b0027cfe711365si2154298pjb.51.2023.10.20.07.51.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 07:51:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 4BAEB836B4C0; Fri, 20 Oct 2023 07:51:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377641AbjJTOvF (ORCPT + 99 others); Fri, 20 Oct 2023 10:51:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377633AbjJTOux (ORCPT ); Fri, 20 Oct 2023 10:50:53 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA591D6D; Fri, 20 Oct 2023 07:50:46 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4SBnYr3rjkz6K7HY; Fri, 20 Oct 2023 22:50:08 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Fri, 20 Oct 2023 15:50:42 +0100 Date: Fri, 20 Oct 2023 15:50:41 +0100 From: Jonathan Cameron To: "Russell King (Oracle)" CC: Helge Deller , "James E.J. Bottomley" , , James Morse , Salil Mehta , Subject: Re: [PATCH] parisc: simplify smp_prepare_boot_cpu() Message-ID: <20231020155041.00006a0a@Huawei.com> In-Reply-To: References: Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100006.china.huawei.com (7.191.160.224) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 20 Oct 2023 07:51:12 -0700 (PDT) On Fri, 20 Oct 2023 15:45:30 +0100 "Russell King (Oracle)" wrote: > smp_prepare_boot_cpu() reads the cpuid of the first CPU, printing a > message to state which processor booted, and setting it online and > present. > > This cpuid is retrieved from per_cpu(cpu_data, 0).cpuid, which is > initialised in arch/parisc/kernel/processor.c:processor_probe() thusly: > > p = &per_cpu(cpu_data, cpuid); > ... > p->cpuid = cpuid; /* save CPU id */ > > Consequently, the cpuid retrieved seems to be guaranteed to also be > zero, meaning that the message printed in this boils down to: > > pr_info("SMP: bootstrap CPU ID is 0\n"); > > Moreover, since kernel/cpu.c::boot_cpu_init() already sets CPU 0 to > be present and online, there is no need to do this again in > smp_prepare_boot_cpu(). > > Remove this code, and simplify the printk(). > > Signed-off-by: Russell King (Oracle) LGTM, but trivial comment inline. > --- > arch/parisc/kernel/smp.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c > index 2019c1f04bd0..989efc8c67a5 100644 > --- a/arch/parisc/kernel/smp.c > +++ b/arch/parisc/kernel/smp.c > @@ -404,13 +404,8 @@ static int smp_boot_one_cpu(int cpuid, struct task_struct *idle) > > void __init smp_prepare_boot_cpu(void) > { > - int bootstrap_processor = per_cpu(cpu_data, 0).cpuid; > - > /* Setup BSP mappings */ Given it's not doing any such thing, I think you should also drop the comment. > - printk(KERN_INFO "SMP: bootstrap CPU ID is %d\n", bootstrap_processor); > - > - set_cpu_online(bootstrap_processor, true); > - set_cpu_present(bootstrap_processor, true); > + pr_info("SMP: bootstrap CPU ID is 0\n"); > } > >