[PATCH] powerpc: change rheap functions to use long integers instead of pointers

Pantelis Antoniou pantelis.antoniou at gmail.com
Thu Apr 5 03:36:02 EST 2007


On 04 Απρ 2007, at 7:42 ΜΜ, Kumar Gala wrote:

>
> On Apr 3, 2007, at 11:02 AM, Timur Tabi wrote:
>
>> (This patch is currently for review only.  It is based on Paul's  
>> for-2.6.22
>> branch.  Please note that the code in this branch is missing many  
>> fixes for
>> 2.6.21, and so some code will not compile.  Specifially, ARCH=ppc  
>> is very
>> broken.)
>>
>> The rheap allocation functions are coded to return a pointer, but  
>> the actual
>> value returned is an offset into a buffer.  Callers of rheap_alloc 
>> () typically
>> cast the return value to an integer.  Similarly, rheap_free() took  
>> a pointer
>> as a parameter, when it should be an unsigned long.
>>
>> This patch changes all of the relevant rheap functions to use an  
>> unsigned long
>> instead of a pointer.  The allocation functions return a signed  
>> long, where a
>> negative number indicates error.
>>
>> All code which calls the rheap functions is updated accordingly.   
>> Macros
>> IS_MURAM_ERR() and IS_DPERR() have been deleted.
>>
>> Signed-off-by: Timur Tabi <timur at freescale.com>
>
> I'm concerned the error handling isn't correctly.  What happens if  
> the rheap I'm managing has addresses at 0xf0000000.  When I compare  
> offset to 0, its going to report as an error, even if the offset  
> returned is valid.
>
> - k
>
>

Exactly,

Using a IMMR of 0xfff0000 is quite common.

Please verify that these cases are handled correctly.

-- Pantelis




More information about the Linuxppc-dev mailing list