[U-Boot] [PATCH] fsl-diu: Using I/O accessor to CCSR space

Kumar Gala galak at kernel.crashing.org
Thu Apr 8 09:58:48 CEST 2010


On Apr 8, 2010, at 2:32 AM, Liu Dave-R63238 wrote:

>>>>> -	if (hw->desc[0] != (unsigned int)ad)
>>>>> -		hw->desc[0] = (unsigned int)ad;
>>>>> +	if (in_be32(&hw->desc[0]) != (unsigned int)ad)
>>>>> +		out_be32(&hw->desc[0], ad);
>>> 
>>>> 'ad' should be cast to a u32, not an "unsigned int".  You 
>>>> shouldn't compare a sized type with an unsized type.
>>> 
>>> Grep the include/asm-ppc/types.h, I got typedef unsigned int u32;
>>> The u32 is same as "unsigned int".
>>> 
>>> Kumar, any comments?
>> 
>> Timur is correct, while u32 is typedef to 'unsigned int' its 
>> cleaner in the code to use u32 and if we have a 64-bit port 
>> of u-boot on PPC in the future it makes things cleaner.
> 
> So, I need to change the (unsigned int)ad to (u32)ad?

yes, please do.  Otherwise patch looked good.

- k


More information about the U-Boot mailing list