of: Fix null pointer related warnings in base.c file
authorSachin Kamat <sachin.kamat@linaro.org>
Wed, 27 Jun 2012 04:14:45 +0000 (09:44 +0530)
committerRob Herring <rob.herring@calxeda.com>
Fri, 6 Jul 2012 12:16:33 +0000 (07:16 -0500)
Fixes the following sparse warnings:
drivers/of/base.c:176:41: warning: Using plain integer as NULL pointer
drivers/of/base.c:178:37: warning: Using plain integer as NULL pointer
drivers/of/base.c:500:49: warning: Using plain integer as NULL pointer

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
drivers/of/base.c

index d9bfd49b193503f61977a7a1c253e0a981ba07b1..ddba57799fd7c9763c60e384d3b5dcc7148d202d 100644 (file)
@@ -173,9 +173,9 @@ struct property *of_find_property(const struct device_node *np,
                return NULL;
 
        read_lock(&devtree_lock);
-       for (pp = np->properties; pp != 0; pp = pp->next) {
+       for (pp = np->properties; pp; pp = pp->next) {
                if (of_prop_cmp(pp->name, name) == 0) {
-                       if (lenp != 0)
+                       if (lenp)
                                *lenp = pp->length;
                        break;
                }
@@ -497,7 +497,7 @@ struct device_node *of_find_node_with_property(struct device_node *from,
        read_lock(&devtree_lock);
        np = from ? from->allnext : allnodes;
        for (; np; np = np->allnext) {
-               for (pp = np->properties; pp != 0; pp = pp->next) {
+               for (pp = np->properties; pp; pp = pp->next) {
                        if (of_prop_cmp(pp->name, prop_name) == 0) {
                                of_node_get(np);
                                goto out;