LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/powermac: Simplify bootx_scan_dt_build_struct()
@ 2026-07-20 23:14 Thorsten Blum
  2026-07-31  7:11 ` Christophe Leroy (CS GROUP)
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-07-20 23:14 UTC (permalink / raw)
  To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP)
  Cc: Thorsten Blum, linuxppc-dev, linux-kernel

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

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 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);


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc/powermac: Simplify bootx_scan_dt_build_struct()
  2026-07-20 23:14 [PATCH] powerpc/powermac: Simplify bootx_scan_dt_build_struct() Thorsten Blum
@ 2026-07-31  7:11 ` Christophe Leroy (CS GROUP)
  0 siblings, 0 replies; 2+ messages in thread
From: Christophe Leroy (CS GROUP) @ 2026-07-31  7:11 UTC (permalink / raw)
  To: Thorsten Blum, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin
  Cc: linuxppc-dev, linux-kernel



Le 21/07/2026 à 01:14, Thorsten Blum a écrit :
> Assign the empty string directly instead of NULL checking namep again.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>

> ---
>   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);



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-31  7:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-20 23:14 [PATCH] powerpc/powermac: Simplify bootx_scan_dt_build_struct() Thorsten Blum
2026-07-31  7:11 ` Christophe Leroy (CS GROUP)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox