Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>

authored by

Sachin Kamat and committed by
Rob Herring
a3a7cab1 177259c3

+3 -3
+3 -3
drivers/of/base.c
··· 173 173 return NULL; 174 174 175 175 read_lock(&devtree_lock); 176 - for (pp = np->properties; pp != 0; pp = pp->next) { 176 + for (pp = np->properties; pp; pp = pp->next) { 177 177 if (of_prop_cmp(pp->name, name) == 0) { 178 - if (lenp != 0) 178 + if (lenp) 179 179 *lenp = pp->length; 180 180 break; 181 181 } ··· 497 497 read_lock(&devtree_lock); 498 498 np = from ? from->allnext : allnodes; 499 499 for (; np; np = np->allnext) { 500 - for (pp = np->properties; pp != 0; pp = pp->next) { 500 + for (pp = np->properties; pp; pp = pp->next) { 501 501 if (of_prop_cmp(pp->name, prop_name) == 0) { 502 502 of_node_get(np); 503 503 goto out;