From: Martin Habets Date: Tue, 10 Oct 2006 01:10:16 +0000 (-0700) Subject: [SPARC32]: Fix prom.c build warning X-Git-Tag: v2.6.19-rc2~207^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=078830eaa8abccd1e95d3effce5b29273bb5ed09;p=platform%2Fupstream%2Fkernel-adaptation-pc.git [SPARC32]: Fix prom.c build warning Fix these 2.6.19-rc1 build warnings: CC arch/sparc/kernel/prom.o arch/sparc/kernel/prom.c: In function `of_set_property': arch/sparc/kernel/prom.c:246: warning: passing arg 2 of `prom_setprop' discards qualifiers from pointer target type arch/sparc/kernel/prom.c: In function `build_one_prop': arch/sparc/kernel/prom.c:446: warning: unused variable `len' arch/sparc/kernel/prom.c:480: warning: ignoring return value of `prom_getproperty', declared with attribute warn_unused_result Signed-off-by: Martin Habets Signed-off-by: David S. Miller --- diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c index 4ca9e5f..2cc302b 100644 --- a/arch/sparc/kernel/prom.c +++ b/arch/sparc/kernel/prom.c @@ -243,7 +243,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len void *old_val = prop->value; int ret; - ret = prom_setprop(dp->node, name, val, len); + ret = prom_setprop(dp->node, (char *) name, val, len); err = -EINVAL; if (ret >= 0) { prop->value = new_val; @@ -477,7 +477,10 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s p->length = 0; } else { p->value = prom_early_alloc(p->length + 1); - prom_getproperty(node, p->name, p->value, p->length); + len = prom_getproperty(node, p->name, p->value, + p->length); + if (len <= 0) + p->length = 0; ((unsigned char *)p->value)[p->length] = '\0'; } }