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:   [EMAIL PROTECTED]
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
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to