From: Paul Mackerras Date: Fri, 6 May 2005 03:29:34 +0000 (+1000) Subject: [PATCH] ppc64: fix prom.c compile warning X-Git-Tag: v3.12-rc1~43686 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3892c5fa9455670466f9f5518b3b7ef12ef3ccd6;p=kernel%2Fkernel-generic.git [PATCH] ppc64: fix prom.c compile warning The code in unflatten_device_tree knows that get_property is written to only return with lenp equal to 1 when also returning a valid pointer. The gcc 3.3.3 compiler is not able to prove this to itself, so it warns about a possible uninitialized pointer dereference: .../arch/ppc64/kernel/prom.c: In function `unflatten_device_tree': .../arch/ppc64/kernel/prom.c:828: warning: `p' might be used uninitialized in this function Unless it is desired to rework the interaction between the two functions, this will keep the existing behavior but quiet the compiler. Signed-off-by: Amos Waterland Signed-off-by: Paul Mackerras Signed-off-by: Linus Torvalds --- diff --git a/arch/ppc64/kernel/prom.c b/arch/ppc64/kernel/prom.c index fe2946c..eb6538b 100644 --- a/arch/ppc64/kernel/prom.c +++ b/arch/ppc64/kernel/prom.c @@ -834,7 +834,7 @@ void __init unflatten_device_tree(void) { unsigned long start, mem, size; struct device_node **allnextp = &allnodes; - char *p; + char *p = NULL; int l = 0; DBG(" -> unflatten_device_tree()\n");