From patchwork Wed May 25 08:14:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 12860799 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3069EC433F5 for ; Wed, 25 May 2022 08:22:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WsTXiXewX8dySWyH3DrnJ9Z21uqdEsi7HtM288qF0Ck=; b=ClnElm6silXrCQ j/+AZFuGNkTcj5/MfvlFk4Juu6L5jM+4I/pyY3B926Q9sRKAow/9CzA+18bpR063GHsODxhhJrwOv PFAcgt8An7VWDorKpDSgQl13pwjmPkLPul8XJXvWsKuEcLqg2XYRhjdM68qT1IiFO12MpTq5Mt+cc MxJ8Do5MJWdHzHKNyozoDzP8jUPEwZmbImCnWut6iHFZLsHaYIoC18GYQct4RbjVYgSGKosR+e3Y8 HgO1jekpab3/nLvqlMfNR5dtPtT62UVgOgvQWG23pLDPvYH1j1wYvOgGnr4vxOs6gF5Uggojxt1a0 0GdJu3KS8vsJRXNjEcwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntmHJ-00AMiF-Rz; Wed, 25 May 2022 08:22:01 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ntmAY-00AIZb-KU; Wed, 25 May 2022 08:15:04 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 036D423A; Wed, 25 May 2022 01:15:02 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5C0683F73D; Wed, 25 May 2022 01:15:00 -0700 (PDT) From: Sudeep Holla To: linux-kernel@vger.kernel.org Cc: Sudeep Holla , Atish Patra , Atish Patra , Vincent Guittot , Morten Rasmussen , Dietmar Eggemann , Qing Wang , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, Rob Herring Subject: [PATCH v3 14/16] arch_topology: Drop unnecessary check for uninitialised package_id Date: Wed, 25 May 2022 09:14:14 +0100 Message-Id: <20220525081416.3306043-15-sudeep.holla@arm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220525081416.3306043-14-sudeep.holla@arm.com> References: <20220525081416.3306043-1-sudeep.holla@arm.com> <20220525081416.3306043-2-sudeep.holla@arm.com> <20220525081416.3306043-3-sudeep.holla@arm.com> <20220525081416.3306043-4-sudeep.holla@arm.com> <20220525081416.3306043-5-sudeep.holla@arm.com> <20220525081416.3306043-6-sudeep.holla@arm.com> <20220525081416.3306043-7-sudeep.holla@arm.com> <20220525081416.3306043-8-sudeep.holla@arm.com> <20220525081416.3306043-9-sudeep.holla@arm.com> <20220525081416.3306043-10-sudeep.holla@arm.com> <20220525081416.3306043-11-sudeep.holla@arm.com> <20220525081416.3306043-12-sudeep.holla@arm.com> <20220525081416.3306043-13-sudeep.holla@arm.com> <20220525081416.3306043-14-sudeep.holla@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220525_011502_870977_0108D410 X-CRM114-Status: GOOD ( 11.18 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org With the support of socket node parsing from the device tree and assigning 0 as package_id in absence of socket nodes, there is no need to check for invalid package_id. It is always initialised to 0 or values from the device tree socket nodes. Just drop that now redundant check for uninitialised package_id. Signed-off-by: Sudeep Holla --- drivers/base/arch_topology.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index e7876a7a82ec..b8f0d72908c8 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -606,7 +606,6 @@ static int __init parse_dt_topology(void) { struct device_node *cn, *map; int ret = 0; - int cpu; cn = of_find_node_by_path("/cpus"); if (!cn) { @@ -628,16 +627,6 @@ static int __init parse_dt_topology(void) topology_normalize_cpu_scale(); - /* - * Check that all cores are in the topology; the SMP code will - * only mark cores described in the DT as possible. - */ - for_each_possible_cpu(cpu) - if (cpu_topology[cpu].package_id < 0) { - ret = -EINVAL; - break; - } - out_map: of_node_put(map); out: