Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1961129rda; Tue, 24 Oct 2023 08:18:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQQfCJCifMRFG3DWoR3XAewGuoU24gdNEjqZ8w2kAYmcQqlZdRuB8joepxb4lJcDJwT1v+ X-Received: by 2002:a17:902:748c:b0:1b9:e913:b585 with SMTP id h12-20020a170902748c00b001b9e913b585mr9281450pll.13.1698160705833; Tue, 24 Oct 2023 08:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698160705; cv=none; d=google.com; s=arc-20160816; b=TcPI2iWCRdD9FF0iulbcfkl4OXYUSfWmp0iJf2twNO6vLKEb8MlXgrz8k6ohOQYW7c ujlnI5QDpn0xI7ZHZZ9SC5yJCN2yAq6KeVKAsqq2TgE4FvJDdUd0dY0iKWNoIwmakJKe DacB76hnSDL6ZQdJaFQ80LwW+Zex6ZNq6I4BXekPPzWwUzOXRUdz8TjWxfk6QmGRgKN2 KSTwt+a1KYVWFuqXPvR2ZdMyElUq4MBipgi6cIy+YgzdQ6FJtXk5RgDeOeb0jarea26K e1u1eI55cimhFRQmSIPVnTlR2EKoPXA+x+vS+RH0Y6CykB/dKv1tC9Am1SlWl72G75pn l70w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:sender:message-id:content-transfer-encoding :content-disposition:mime-version:subject:cc:to:from:references :in-reply-to:dkim-signature; bh=B2mYLeaTLi2RKWi068dxPknxY80IYTqbrhnkvkRDiuE=; fh=vGp9XFM4D1RKi7jyAIjKAaHKfpl3Nk8bXN5xkWYvhvI=; b=CAHeVN6KP1S4HpoHcGw+pBlmIp4RjfF0bjXqaWUr2vCj/nyL+6b3J6YrV8mjOxUy8S F712oNtFEKrDMgrOof464d//EuAx4V12BTU1Uv9OEHwVYjCMQFvnVzWiax589BZ3Q76u qQN9CxC+j8Qfw94ONt2qHffWR9prq+06NafEOwro+0F0j5iMUItAbLfIZca+YPEFyp8w fUQXJSliUSKC8GHfQPhhir6suEHs214OJzAmpx211dg0Ln/rkVrHfE+LyzdPzpANt5bB 1DY+8vZMF8chm5kwQ4F9hbH334buMRtngW0JNhCqfT9nU9OXMNfwehWqZORmsMxu//LA hWNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=I70Rxnbd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id u3-20020a17090282c300b001c75540d9fesi8177068plz.587.2023.10.24.08.18.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 08:18:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=I70Rxnbd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 447E5802390F; Tue, 24 Oct 2023 08:18:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234863AbjJXPSM (ORCPT + 99 others); Tue, 24 Oct 2023 11:18:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343758AbjJXPRh (ORCPT ); Tue, 24 Oct 2023 11:17:37 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF06510D7; Tue, 24 Oct 2023 08:17:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=B2mYLeaTLi2RKWi068dxPknxY80IYTqbrhnkvkRDiuE=; b=I70Rxnbd6kfHWLvzXhKgA6tn59 7ODI34RGOfhy5ueFd9D+0uNxcfVW2BD2uVOCNlByiACzQ4c1o+1dx3I1LWYh5JIwh+iEmuo6y1p7r RpgJ4IC9aWhs7ujI+XgqNVlu+DXNDM8jFJuA7lJKxREszppfR3Txvb6XX9H7k3LEXCLQxhNciZqt/ saTsEAO85uB+OYAdOuoJdRTYGAm8hx8kAcwQNYSS+NSJtU5ExBi5TwmSaFTSeacrCna1j33jelM53 RmmJmKJ3SZ4UIJLOoW+5j18YgED6g79C6l2naF896U7b7AcQ5Fa1edwSBkBUOltI94tRjfLU9QtZ8 c1OMvi/g==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:56504 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qvJ9K-0004Nb-0X; Tue, 24 Oct 2023 16:16:54 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qvJ9L-00AqPe-JF; Tue, 24 Oct 2023 16:16:55 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: linux-pm@vger.kernel.org, loongarch@lists.linux.dev, linux-acpi@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, kvmarm@lists.linux.dev, x86@kernel.org, linux-csky@vger.kernel.org, linux-doc@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org Cc: Salil Mehta , Jean-Philippe Brucker , jianyong.wu@arm.com, justin.he@arm.com, James Morse , Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: [PATCH 09/39] drivers: base: remove unnecessary call to register_cpu_under_node() MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Tue, 24 Oct 2023 16:16:55 +0100 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 24 Oct 2023 08:18:22 -0700 (PDT) Since "drivers: base: Move cpu_dev_init() after node_dev_init()", we can remove some redundant code. node_dev_init() will walk through the nodes calling register_one_node() on each. This will trickle down to __register_one_node() which walks all present CPUs, calling register_cpu_under_node() on each. register_cpu_under_node() will call get_cpu_device(cpu) for each, which will return NULL until the CPU is registered using register_cpu(). This now happens _after_ node_dev_init(). Therefore, calling register_cpu_under_node() from __register_one_node() becomes a no-op, and can be removed. Signed-off-by: Russell King (Oracle) --- drivers/base/node.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/base/node.c b/drivers/base/node.c index 493d533f8375..4d5ac7cf8757 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -867,7 +867,6 @@ void register_memory_blocks_under_node(int nid, unsigned long start_pfn, int __register_one_node(int nid) { int error; - int cpu; node_devices[nid] = kzalloc(sizeof(struct node), GFP_KERNEL); if (!node_devices[nid]) @@ -875,12 +874,6 @@ int __register_one_node(int nid) error = register_node(node_devices[nid], nid); - /* link cpu under this node */ - for_each_present_cpu(cpu) { - if (cpu_to_node(cpu) == nid) - register_cpu_under_node(cpu, nid); - } - INIT_LIST_HEAD(&node_devices[nid]->access_list); node_init_caches(nid); -- 2.30.2