[lkml]   [2010]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectcleaning up some inline kfifo docs

(primarily to stefani but others are free to jump in.)

a few things that can be tweaked in <linux/kfifo.h>, but i'd rather
leave that to the maintainer.

besides some pedantic typoes in kfifo.h, there is a mismatch in the
rounding info. kfifo.h reads:

"* The numer of elements will be rounded-up to a power of 2."

while kernel/kfifo.c makes it clear that it goes the other way:

int __kfifo_alloc(struct __kfifo *fifo, unsigned int size,
size_t esize, gfp_t gfp_mask)
* round down to the next power of 2, since our 'let the indices
* wrap' technique works only in this case.
if (!is_power_of_2(size))
size = rounddown_pow_of_two(size);

so the kfifo.h claim should be fixed. also, in a number of places,
kfifo.h claims that the size passed to the kfifo creation routine
*must* be a power of two when, clearly, it doesn't have to be; it will
simply be *rounded* to such a power as needed.

take it away, stefani ...



Robert P. J. Day Waterloo, Ontario, CANADA


 \ /
  Last update: 2010-11-21 15:17    [W:0.028 / U:1.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site