Skip to contentSkip to conversation

sparc: Compare pointers to NULL instead of 0

PATCH In review Thorsten Blum 2 participants 2 messages Apr 4, 2024 – Apr 22, 2024 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sparc: Compare pointers to NULL instead of 0

Fixes the following two Coccinelle/coccicheck warnings reported by badzero.cocci:

WARNING comparing pointer to 0
WARNING comparing pointer to 0

---
 arch/sparc/prom/tree_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/prom/tree_64.c +1 -1
index 989e7992d629..88793e5b0ab5 100644
@@ -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
Signature · 1 line
2.44.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Thorsten Blum

Fixes the following two Coccinelle/coccicheck warnings reported by badzero.cocci:

WARNING comparing pointer to 0
WARNING comparing pointer to 0

---
 arch/sparc/prom/tree_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/prom/tree_64.c +0 -0
index 989e7992d629..88793e5b0ab5 100644

arch/sparc/prom/tree_64.c prom_setprop(phandle node, const char *pname, char *value, int size) · line 338

Quoted 8 lines
arch/sparc/prom/tree_64.c +1 -1
@@ -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

Picking this up to my for-next

Thanks,
Andreas