[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220704101605.1318280-16-sudeep.holla@arm.com>
Date: Mon, 4 Jul 2022 11:15:59 +0100
From: Sudeep Holla <sudeep.holla@....com>
To: linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Sudeep Holla <sudeep.holla@....com>, conor.dooley@...rochip.com,
valentina.fernandezalanis@...rochip.com,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Qing Wang <wangqing@...o.com>,
Rob Herring <robh+dt@...nel.org>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Ionela Voinescu <ionela.voinescu@....com>,
Pierre Gondois <pierre.gondois@....com>,
linux-arm-kernel@...ts.infradead.org,
linux-riscv@...ts.infradead.org, Gavin Shan <gshan@...hat.com>
Subject: [PATCH v6 15/21] arch_topology: Avoid parsing through all the CPUs once a outlier CPU is found
There is no point in looping through all the CPU's physical package
identifier to check if it is valid or not once a CPU which is outside
the topology(i.e. outlier CPU) is found.
Let us just break out of the loop early in such case.
Tested-by: Ionela Voinescu <ionela.voinescu@....com>
Reviewed-by: Gavin Shan <gshan@...hat.com>
Signed-off-by: Sudeep Holla <sudeep.holla@....com>
---
drivers/base/arch_topology.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index c0b0ee64a79d..8f6a964d2512 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -642,8 +642,10 @@ static int __init parse_dt_topology(void)
* only mark cores described in the DT as possible.
*/
for_each_possible_cpu(cpu)
- if (cpu_topology[cpu].package_id < 0)
+ if (cpu_topology[cpu].package_id < 0) {
ret = -EINVAL;
+ break;
+ }
out_map:
of_node_put(map);
--
2.37.0
Powered by blists - more mailing lists