[PATCH] powerpc: fix uninitialised error in numa.c

Tony Breeds tony at bakeyournoodle.com
Wed Jun 20 15:38:08 EST 2012


On Wed, Jun 20, 2012 at 02:17:47PM +1000, Michael Neuling wrote:
> chroma_defconfig currently gives me this with gcc 4.6:
>   arch/powerpc/mm/numa.c:638:13: error: 'dm' may be used uninitialized in this function [-Werror=uninitialized]
> 
> It's a bogus warning since of_get_drconf_memory() only writes it
> anyway.  
> 
> Signed-off-by: Michael Neuling <mikey at neuling.org>
> cc: stable at kernel.org
> ---
> Also affects 3.4 and 3.3 stable.
> 
> diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
> index 5ca3a15..880acde 100644
> --- a/arch/powerpc/mm/numa.c
> +++ b/arch/powerpc/mm/numa.c
> @@ -637,7 +637,7 @@ static inline int __init read_usm_ranges(const u32 **usm)
>   */
>  static void __init parse_drconf_memory(struct device_node *memory)
>  {
> -	const u32 *dm, *usm;
> +	const u32 *dm = NULL, *usm;

Woot bikeshed!  I think that's what the uninitialized_var() macro is for.

Yours Tony
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20120620/119babef/attachment.sig>


More information about the Linuxppc-dev mailing list