Skip to content

Commit

Permalink
of: Fix null pointer related warnings in base.c file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sachin Kamat authored and Rob Herring committed Jul 6, 2012
1 parent 177259c commit a3a7cab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a3a7cab

Please sign in to comment.