Commit a3a7cab1 authored by Sachin Kamat's avatar Sachin Kamat Committed by Rob Herring

of: Fix null pointer related warnings in base.c file

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: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarRob Herring <rob.herring@calxeda.com>
parent 177259c3
...@@ -173,9 +173,9 @@ struct property *of_find_property(const struct device_node *np, ...@@ -173,9 +173,9 @@ struct property *of_find_property(const struct device_node *np,
return NULL; return NULL;
read_lock(&devtree_lock); 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 (of_prop_cmp(pp->name, name) == 0) {
if (lenp != 0) if (lenp)
*lenp = pp->length; *lenp = pp->length;
break; break;
} }
...@@ -497,7 +497,7 @@ struct device_node *of_find_node_with_property(struct device_node *from, ...@@ -497,7 +497,7 @@ struct device_node *of_find_node_with_property(struct device_node *from,
read_lock(&devtree_lock); read_lock(&devtree_lock);
np = from ? from->allnext : allnodes; np = from ? from->allnext : allnodes;
for (; np; np = np->allnext) { 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) { if (of_prop_cmp(pp->name, prop_name) == 0) {
of_node_get(np); of_node_get(np);
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment