Thread (29 messages) 29 messages, 9 authors, 2021-10-27

Re: [PATCH 06/12] openrisc: Use of_get_cpu_hwid()

From: Rob Herring <robh@kernel.org>
Date: 2021-10-06 21:09:05
Also in: linux-arm-kernel, linux-riscv, linux-sh, linuxppc-dev, lkml

On Wed, Oct 6, 2021 at 3:44 PM Stafford Horne [off-list ref] wrote:
On Wed, Oct 06, 2021 at 11:43:26AM -0500, Rob Herring wrote:
quoted
Replace open coded parsing of CPU nodes' 'reg' property with
of_get_cpu_hwid().

Cc: Jonas Bonn <jonas@southpole.se>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Stafford Horne <shorne@gmail.com>
Cc: openrisc@lists.librecores.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 arch/openrisc/kernel/smp.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/arch/openrisc/kernel/smp.c b/arch/openrisc/kernel/smp.c
index 415e209732a3..7d5a4f303a5a 100644
--- a/arch/openrisc/kernel/smp.c
+++ b/arch/openrisc/kernel/smp.c
@@ -65,11 +65,7 @@ void __init smp_init_cpus(void)
      u32 cpu_id;

      for_each_of_cpu_node(cpu) {
-             if (of_property_read_u32(cpu, "reg", &cpu_id)) {
-                     pr_warn("%s missing reg property", cpu->full_name);
-                     continue;
-             }
-
+             cpu_id = of_get_cpu_hwid(cpu);
Oops, that should be: of_get_cpu_hwid(cpu, 0);

I thought I double checked all those...
You have defined of_get_cpu_hwid to return u64, will this create compiler
warnings when since we are storing a u64 into a u32?
I'm counting on the caller to know the max size for their platform.
It seems only if we make with W=3.

I thought we usually warned on this.  Oh well, for the openrisc bits.
That's only on ptr truncation I think.
Acked-by: Stafford Horne <shorne@gmail.com>
quoted
              if (cpu_id < NR_CPUS)
                      set_cpu_possible(cpu_id, true);
      }
--
2.30.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help