[U-Boot-Users] FIX: dataflash.c

Michael Trimarchi trimarchi at gandalf.sssup.it
Sun Aug 19 21:27:01 CEST 2007


Ulf Samuelsson wrote:
>>  for (i = 0; i < CFG_MAX_DATAFLASH_BANKS; i++)
>>  if ( dataflash_info[i].id
>> - && ((((int) addr) & 0xFF000000) ==
>> + && ((((unsigned int) *addr) & 0xFF000000) ==
>>  dataflash_info[i].logical_address)) {
>>  addr_valid = 1;
>>  break;
>>
>> It fix an invalid use of a pointer and and invalid use of an array.
>>
>> regards michael
>>
>>
>>     
>
> AFAIK, This patch is introducing a bug.
>
> The intention of the code is to check if  "addr" is within
> 0xC0000000..0xCFFFFFFF    or
> 0xD0000000..0xDFFFFFFF.
>
> Your patch will make the ARM core *read* from whereever 'addr' is pointing at.
>
>   
The patch is only reversed.
- new code
+ old code
Regards Michael





More information about the U-Boot mailing list