sparc: Compare pointers to NULL instead of 0
authorThorsten Blum <thorsten.blum@toblux.com>
Thu, 4 Apr 2024 19:29:33 +0000 (21:29 +0200)
committerAndreas Larsson <andreas@gaisler.com>
Mon, 22 Apr 2024 14:45:52 +0000 (16:45 +0200)
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>
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Link: https://lore.kernel.org/r/20240404192932.13075-2-thorsten.blum@toblux.com
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
arch/sparc/prom/tree_64.c

index 989e7992d6297261b95be58c843343b9450db911..88793e5b0ab563156432682034a66484c742f584 100644 (file)
@@ -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