powerpc/powermac: Simplify bootx_scan_dt_build_struct()
Subsystems (2)
PATCH 1/1 powerpc/powermac: Simplify bootx_scan_dt_build_struct()
Assign the empty string directly instead of NULL checking namep again.
Signed-off-by Thorsten Blum <[email protected]>
--- arch/powerpc/platforms/powermac/bootx_init.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/powerpc/platforms/powermac/bootx_init.c +1 -3
@@ -284,9 +284,7 @@ static void __init bootx_scan_dt_build_struct(unsigned long base,dt_push_token (OF_DT_BEGIN_NODE , mem_end);/* get the node's full name */ - namep = np->full_name ? (char *)(base + np->full_name) :NULL ; -if (namep ==NULL ) - namep ="" ; + namep = np->full_name ? (char *)(base + np->full_name) :"" ; l =strlen (namep);DBG ("* struct: %s\n" , namep);
Le 21/07/2026 à 01:14, Thorsten Blum a écrit :
Quoted 3 lines
Assign the empty string directly instead of NULL checking namep again.
Signed-off-by Thorsten Blum <[email protected]>
Reviewed-by Christophe Leroy (CS GROUP) <[email protected]>
Quoted 19 lines
--- arch/powerpc/platforms/powermac/bootx_init.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)arch/powerpc/platforms/powermac/bootx_init.c +1
-3@@ -284,9 +284,7 @@ static void __init bootx_scan_dt_build_struct(unsigned long base,dt_push_token (OF_DT_BEGIN_NODE , mem_end);/* get the node's full name */ - namep = np->full_name ? (char *)(base + np->full_name) :NULL ; -if (namep ==NULL ) - namep ="" ; + namep = np->full_name ? (char *)(base + np->full_name) :"" ; l =strlen (namep);DBG ("* struct: %s\n" , namep);
Quoted 3 lines · Thorsten Blum
Assign the empty string directly instead of NULL checking namep again.
Applied to powerpc/next.
[1/1] powerpc/powermac: Simplify bootx_scan_dt_build_struct()
https://git.kernel.org/powerpc/c/a2144b13a6ec01e2298c88548af2e3f6d1163de6
cheers