Re: [PATCH 2/2] fsl/embedded6xx: don't cast the result of of_get_property

2007-09-26 Thread Segher Boessenkool
>> -avr_clock = *(u32*)of_get_property(avr, "clock-frequency", &len); >> -phys_addr = ((u32*)of_get_property(avr, "reg", &len))[0]; >> +phys_addr = of_get_property(avr, "reg", &len); >> +avr_clock_prop = of_get_property(avr, "clock-frequency", &len); > > If you don't use the value o

Re: [PATCH 2/2] fsl/embedded6xx: don't cast the result of of_get_property

2007-09-25 Thread Stephen Rothwell
On Wed, 26 Sep 2007 10:52:23 +1000 Jeremy Kerr <[EMAIL PROTECTED]> wrote: > > Stephen, > > > If you don't use the value of the len variable, then you can pass > > NULL to of_get_property. > > Sure, but that's probably a separate patch, no ? OK. > > Not *phys_addr? > > That's what the existing

Re: [PATCH 2/2] fsl/embedded6xx: don't cast the result of of_get_property

2007-09-25 Thread Jeremy Kerr
Stephen, > If you don't use the value of the len variable, then you can pass > NULL to of_get_property. Sure, but that's probably a separate patch, no ? > Not *phys_addr? That's what the existing code does. I'm guessing that it treats phys_addr as an array with one entry, not a single u32. Ch

Re: [PATCH 2/2] fsl/embedded6xx: don't cast the result of of_get_property

2007-09-25 Thread Stephen Rothwell
On Fri, 14 Sep 2007 15:46:40 +1000 Jeremy Kerr <[EMAIL PROTECTED]> wrote: > > - avr_clock = *(u32*)of_get_property(avr, "clock-frequency", &len); > - phys_addr = ((u32*)of_get_property(avr, "reg", &len))[0]; > + phys_addr = of_get_property(avr, "reg", &len); > + avr_clock_prop = of_

Re: [PATCH 2/2] fsl/embedded6xx: don't cast the result of of_get_property

2007-09-25 Thread Kumar Gala
On Sep 14, 2007, at 12:46 AM, Jeremy Kerr wrote: > Use a temporary variable of the correct type instead. > > Also, this allows us to check the return value in ls_uarts_init, to > avoid dereferencing a null pointer if required properties aren't > present. > > Signed-off-by: Jeremy Kerr <[EMAIL PRO

[PATCH 2/2] fsl/embedded6xx: don't cast the result of of_get_property

2007-09-13 Thread Jeremy Kerr
Use a temporary variable of the correct type instead. Also, this allows us to check the return value in ls_uarts_init, to avoid dereferencing a null pointer if required properties aren't present. Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]> --- arch/powerpc/platforms/embedded6xx/ls_uart.c |