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

Segher Boessenkool segher at kernel.crashing.org
Wed Sep 26 22:55:18 EST 2007


>> -	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 of the len variable, then you can pass NULL 
> to
> of_get_property.

OTOH, it is almost always an error to not use the length (missing
error check).


Segher




More information about the Linuxppc-dev mailing list