[PATCH] Split initrd logic out of early_init_dt_scan_chosen() to fix warning

Geert Uytterhoeven Geert.Uytterhoeven at sonycom.com
Thu May 10 17:48:42 EST 2007


On Thu, 10 May 2007, Michael Ellerman wrote:
> If CONFIG_BLK_DEV_INITRD is not defined the prop variable in
> early_init_dt_scan_chosen() is unused, causing a compiler warning.
> 
> So split the initrd logic into a separate function, allowing us to
> declare prop only when we need it.
> 
> Built for both cases and booted with an initrd.
> 
> Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
> ---
> 
>  arch/powerpc/kernel/prom.c |   48 ++++++++++++++++++++++++++++++---------------
>  1 file changed, 32 insertions(+), 16 deletions(-)
> 
> Index: powerpc/arch/powerpc/kernel/prom.c
> ===================================================================
> --- powerpc.orig/arch/powerpc/kernel/prom.c
> +++ powerpc/arch/powerpc/kernel/prom.c
> @@ -716,11 +716,41 @@ static int __init early_init_dt_scan_cpu
>  	return 0;
>  }
>  
> +#ifdef CONFIG_BLK_DEV_INITRD

> +#else
> +static inline void early_init_dt_check_for_initrd(unsigned long node)
> +{
> +	return;
> +}
> +#endif /* CONFIG_BLK_DEV_INITRD */

There's no need to use `return' in functions returning void.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven at sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium



More information about the Linuxppc-dev mailing list