Skip to contentSkip to conversation

powerpc/powermac: Simplify bootx_scan_dt_build_struct()

PATCH Applied Thorsten Blum 3 participants 3 messages Jul 20 – Aug 3

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/powermac: Simplify bootx_scan_dt_build_struct()

Assign the empty string directly instead of NULL checking namep again.

---
 arch/powerpc/platforms/powermac/bootx_init.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/powerpc/platforms/powermac/bootx_init.c +1 -3
index 72eb99aba40f..abceae91dfde 100644
@@ -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);
reviewer Reviewed-by on v1 1/1
#1 lore raw

Le 21/07/2026 à 01:14, Thorsten Blum a écrit :

Quoted 3 lines

Assign the empty string directly instead of NULL checking namep again.

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
index 72eb99aba40f..abceae91dfde 100644
@@ -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);