Re: [PATCH UPDATED 09/10] percpu: implement new dynamic percpu allocator

From: Tejun Heo
Date: Fri Feb 20 2009 - 22:23:56 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/