Skip to contentSkip to conversation

0 -> NULL, for arch/sparc64

PATCH Applied Yoann Padioleau 1 participant 1 message Jul 27, 2007 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 17/68 0 -> NULL, for arch/sparc64

When comparing a pointer, it's clearer to compare it to NULL than to 0.

Here is an excerpt of the semantic patch:

@@
expression *E;
@@

E =
- 0
+ NULL

@@
expression *E;
@@

E !- 0
+ NULL

---

 kernel/prom.c |    2 +-
 prom/tree.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/sparc64/kernel/prom.c +1 -1
index f4e0a9a..35d4eb5 100644
@@ -38,7 +38,7 @@ struct device_node *of_find_node_by_phan
 {
 	struct device_node *np;
 
-	for (np = allnodes; np != 0; np = np->allnext)
+	for (np = allnodes; np != NULL; np = np->allnext)
 		if (np->node = handle)
 			break;
 
arch/sparc64/prom/tree.c +1 -1
index b2c5b12..33eacd0 100644
@@ -264,7 +264,7 @@ prom_setprop(int node, const char *pname
 {
 	if (size = 0)
 		return 0;
-	if ((pname = 0) || (value = 0))
+	if ((pname = NULL) || (value = NULL))
 		return 0;
 	
 #ifdef CONFIG_SUN_LDOMS