diff mbox series

sparc: Compare pointers to NULL instead of 0

Message ID 20240404192932.13075-2-thorsten.blum@toblux.com
State New
Headers show
Series sparc: Compare pointers to NULL instead of 0 | expand

Commit Message

Thorsten Blum April 4, 2024, 7:29 p.m. UTC
Fixes the following two Coccinelle/coccicheck warnings reported by
badzero.cocci:

	WARNING comparing pointer to 0
	WARNING comparing pointer to 0

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
---
 arch/sparc/prom/tree_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andreas Larsson April 22, 2024, 2:43 p.m. UTC | #1
On 2024-04-04 21:29, Thorsten Blum wrote:
> Fixes the following two Coccinelle/coccicheck warnings reported by
> badzero.cocci:
> 
> 	WARNING comparing pointer to 0
> 	WARNING comparing pointer to 0
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
> ---
>  arch/sparc/prom/tree_64.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/sparc/prom/tree_64.c b/arch/sparc/prom/tree_64.c
> index 989e7992d629..88793e5b0ab5 100644
> --- a/arch/sparc/prom/tree_64.c
> +++ b/arch/sparc/prom/tree_64.c
> @@ -332,7 +332,7 @@ prom_setprop(phandle node, const char *pname, char *value, int size)
>  
>  	if (size == 0)
>  		return 0;
> -	if ((pname == 0) || (value == 0))
> +	if ((pname == NULL) || (value == NULL))
>  		return 0;
>  	
>  #ifdef CONFIG_SUN_LDOMS

Reviewed-by: Andreas Larsson <andreas@gaisler.com>

Picking this up to my for-next

Thanks,
Andreas
diff mbox series

Patch

diff --git a/arch/sparc/prom/tree_64.c b/arch/sparc/prom/tree_64.c
index 989e7992d629..88793e5b0ab5 100644
--- a/arch/sparc/prom/tree_64.c
+++ b/arch/sparc/prom/tree_64.c
@@ -332,7 +332,7 @@  prom_setprop(phandle node, const char *pname, char *value, int size)
 
 	if (size == 0)
 		return 0;
-	if ((pname == 0) || (value == 0))
+	if ((pname == NULL) || (value == NULL))
 		return 0;
 	
 #ifdef CONFIG_SUN_LDOMS