[patch 3/6] PS3: Bootwrapper improvements

Geert Uytterhoeven Geert.Uytterhoeven at sonycom.com
Thu Mar 27 19:13:39 EST 2008


On Wed, 26 Mar 2008, Geoff Levand wrote:
> --- a/arch/powerpc/boot/ps3.c
> +++ b/arch/powerpc/boot/ps3.c
>  }
>  
> -void platform_init(void)
> +void platform_init(unsigned long null_check)
                      ^^^^^^^^^^^^^^^^^^^^^^^^
>  {
>  	const u32 heapsize = 0x1000000 - (u32)_end; /* 16MiB */
>  	void *chosen;
> @@ -151,6 +152,10 @@ void platform_init(void)
>  
>  	printf(" flat tree at 0x%lx\n\r", ft_addr);
>  
> +	if (*(unsigned long *)0 != null_check)
> +		printf("null check failed: %lx != %lx\n\r", *(unsigned long *)0,
> +			(unsigned long)null_check);
                        ^^^^^^^^^^^^^^^
This cast is not needed, as null_check has the correct type.

BTW, what about writing it like

	unsigned long val;

	val = *(unsigned long *)0;
	if (val != null_check)
		printf("null check failed: %lx != %lx\n\r", val, null_check);

to kill a duplicate cast and avoid splitting the printf() line?

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven at sonycom.com
Internet: http://www.sony-europe.com/

Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619


More information about the Linuxppc-dev mailing list