lkml.org 
[lkml]   [2009]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH UPDATED 09/10] percpu: implement new dynamic percpu allocator
Andrew Morton wrote:
>> +void *pcpu_base_addr;
>> +EXPORT_SYMBOL_GPL(pcpu_base_addr);
>> +
>> +/* the size of kernel static area */
>> +static int pcpu_static_size;
>
> It would be nice to document the units of the `size' variables. Bytes?
> Pages?

I almost always use size for bytes, so it isn't confusing to me.

> Or, better: s/size/bytes/g.
>
>> +static int pcpu_size_to_slot(int size)
>> +{
>> + int highbit = fls(size);
>> + return max(highbit - PCPU_SLOT_BASE_SHIFT + 2, 1);
>> +}
>
> See,
>
> static int pcpu_bytes_to_slot(int bytes)
> {
> int highbit = fls(bytes);
> return max(highbit - PCPU_SLOT_BASE_SHIFT + 2, 1);
> }
>
> is clearer.

but, yeah, I agree. I'll post a patch to do the renaming.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2009-02-21 04:27    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site