powerpc: powermac: Use of_get_cpu_hwid() to read CPU node 'reg'
Subsystems (2)
PATCH 1/1 powerpc: powermac: Use of_get_cpu_hwid() to read CPU node 'reg'
Replace open coded reading of CPU nodes' "reg" properties with of_get_cpu_hwid() dedicated for this purpose.
--- arch/powerpc/platforms/powermac/feature.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/powerpc/platforms/powermac/feature.c +6 -6
@@ -1053,11 +1053,11 @@ core99_reset_cpu(struct device_node *node, long param, long value)return -ENODEV ;for_each_of_cpu_node (np) { -const u32 *num =of_get_property (np,"reg" ,NULL );const u32 *rst =of_get_property (np,"soft-reset" ,NULL ); -if (num ==NULL || rst ==NULL ) +if (!rst)continue ; -if (param == *num) { +if (param ==of_get_cpu_hwid (np,0 )) { +of_node_put (np); reset_io = *rst;break ; }
@@ -1499,11 +1499,11 @@ static long g5_reset_cpu(struct device_node *node, long param, long value)return -ENODEV ;for_each_of_cpu_node (np) { -const u32 *num =of_get_property (np,"reg" ,NULL );const u32 *rst =of_get_property (np,"soft-reset" ,NULL ); -if (num ==NULL || rst ==NULL ) +if (!rst)continue ; -if (param == *num) { +if (param ==of_get_cpu_hwid (np,0 )) { +of_node_put (np); reset_io = *rst;break ; }
Signature · 1 line
2.39.2
Michael Ellerman
AppliedQuoted 4 lines · Rob Herring
Replace open coded reading of CPU nodes' "reg" properties with
of_get_cpu_hwid()dedicated for this purpose.
Applied to powerpc/next.
[1/1] powerpc: powermac: Use of_get_cpu_hwid() to read CPU node 'reg'
https://git.kernel.org/powerpc/c/bc1cf75027585f8d87f94e464ee5909acf885a8c
cheers
Le 03/07/2023 à 07:26, Michael Ellerman a écrit :
Quoted 6 lines · Rob Herring
Quoted 4 lines
Replace open coded reading of CPU nodes' "reg" properties with
of_get_cpu_hwid()dedicated for this purpose.
Quoted 7 lines
Applied to powerpc/next.
[1/1] powerpc: powermac: Use
of_get_cpu_hwid()to read CPU node 'reg'https://git.kernel.org/powerpc/c/bc1cf75027585f8d87f94e464ee5909acf885a8ccheers
Hi,
I guess, that it does not really matter, but shouldn't the of_node_put() be *after* the "reset_io = *rst;" statements to be absolutely safe?
(This change is in my backlog and I have apparently never proposed it)
CJ
Le 03/07/2023 à 19:01, Christophe JAILLET a écrit :
Quoted 16 lines
Le 03/07/2023 à 07:26, Michael Ellerman a écrit :
Quoted 6 lines · Rob Herring
Quoted 4 lines
Replace open coded reading of CPU nodes' "reg" properties with
of_get_cpu_hwid()dedicated for this purpose.Quoted 8 lines
Applied to powerpc/next.
[1/1] powerpc: powermac: Use
of_get_cpu_hwid()to read CPU node 'reg'https://git.kernel.org/powerpc/c/bc1cf75027585f8d87f94e464ee5909acf885a8c
cheers
Quoted 6 lines
Hi,
I guess, that it does not really matter, but shouldn't the
of_node_put()be *after* the "reset_io= *rst;" statements to be absolutely safe?(This change is in my backlog and I have apparently never proposed it)
Well, in fact is was in:
https://lore.kernel.org/all/f2186955f310494f10990b5c402ada164d7834b8.1619188632.git.christophe.jaillet@wanadoo.fr/
Quoted 3 lines
CJ
Michael Ellerman
reviewerQuoted 12 lines · Christophe JAILLET
Le 03/07/2023 à 07:26, Michael Ellerman a écrit :
Quoted 11 lines · Rob Herring
Quoted 4 lines
Replace open coded reading of CPU nodes' "reg" properties with
of_get_cpu_hwid()dedicated for this purpose.Applied to powerpc/next.
[1/1] powerpc: powermac: Use
of_get_cpu_hwid()to read CPU node 'reg'https://git.kernel.org/powerpc/c/bc1cf75027585f8d87f94e464ee5909acf885a8c
Quoted 8 lines
Quoted 2 lines
cheers
Hi,
I guess, that it does not really matter, but shouldn't the
of_node_put()be *after* the "reset_io= *rst;" statements to be absolutely safe?
Technically yes.
Quoted 1 line
(This change is in my backlog and I have apparently never proposed it)
Can you rebase and resend?
cheers