All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kfifo: fix kfifo_init comment about power of 2 rounding
@ 2022-03-22 19:38 Tyrel Datwyler
  0 siblings, 0 replies; only message in thread
From: Tyrel Datwyler @ 2022-03-22 19:38 UTC (permalink / raw
  To: linux-kernel; +Cc: stefani, torvlds, Tyrel Datwyler

Since, Commit ab9bb6318b09 ("Partially revert "kfifo: fix kfifo_alloc()
and kfifo_init()"") kfifo_init() rounds the preallocated buffer size
down to a power of 2 to determine the number of kfifo elements. The
documentation around the kfifo_init() macro was not updated to reflect
this change from the previous behavior that rounded up to a power of 2.

Fixes: ab9bb6318b09 ("Partially revert "kfifo: fix kfifo_alloc() and kfifo_init()"")
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
---
 include/linux/kfifo.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index 86249476b57f..123fa759bba9 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -378,7 +378,7 @@ __kfifo_int_must_check_helper( \
  *
  * This macro initializes a fifo using a preallocated buffer.
  *
- * The number of elements will be rounded-up to a power of 2.
+ * The number of elements will be rounded-down to a power of 2.
  * Return 0 if no error, otherwise an error code.
  */
 #define kfifo_init(fifo, buffer, size) \
-- 
2.35.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-22 19:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-22 19:38 [PATCH] kfifo: fix kfifo_init comment about power of 2 rounding Tyrel Datwyler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.