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

Sylvain Munaut tnt at 246tNt.com
Thu Apr 5 05:31:53 EST 2007


Timur Tabi wrote:
> Dan Malek wrote:
>
>> How about just leaving it alone?  
>
> Panto said a while back that using unsigned long instead of void * is
> better.
>
> > A void * is
>> perfectly valid as rheap could be used to manage
>> any address space. 
>
> And therefore, it shouldn't be a pointer, because that implies that it
> can be dereferenced.  An unsigned long is a better type to use for a
> generic value than a void pointer.
FWIW, I agree that unsigned long is better. If it can hold anything, it
shouldn't be a pointer. And since currently _all_ users use it to store
offset, that removes a lot of un-necessary casts.

>> you are reducing
>> it's capability (by taking it's object management
>> outside of the kernel virtual space), 
>
> Sorry, I don't understand that.
Actually the returned value don't change so all it does is to shed some
light on some previously present but unseen issues ...
>
>> and you are
>> introducing concerns for error conditions of
>> current users.
>
> I'm fixing those by changing the type from long to ulong and using
> IS_ERR_VALUE().
That looks good to me ...


    Sylvain




More information about the Linuxppc-dev mailing list