[PATCH] powerpc/powermac: Simplify bootx_scan_dt_build_struct()

Thorsten Blum <[email protected]>
Newsgroups gmane.linux.ports.ppc.embedded
Message-ID <20260720231453.117271-2-thorsten.blum__42771.1938902334$1784589344$gmane$org@linux.dev>
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(-)

diff --git a/arch/powerpc/platforms/powermac/bootx_init.c b/arch/powerpc/platforms/powermac/bootx_init.c
index 72eb99aba40f..abceae91dfde 100644
--- a/arch/powerpc/platforms/powermac/bootx_init.c
+++ b/arch/powerpc/platforms/powermac/bootx_init.c
@@ -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);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.