[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1011210909430.10696@localhost6.localdomain6>
Date: Sun, 21 Nov 2010 09:15:22 -0500 (EST)
From: "Robert P. J. Day" <rpjday@...shcourse.ca>
To: Stefani Seibold <stefani@...bold.net>
cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: cleaning 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 ...
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists