mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tyrel Datwyler <tyreld@linux.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: stefani@seibold.net, torvlds@linux-foundation.org,
	Tyrel Datwyler <tyreld@linux.ibm.com>
Subject: [PATCH] kfifo: fix kfifo_init comment about power of 2 rounding
Date: Tue, 22 Mar 2022 12:38:13 -0700	[thread overview]
Message-ID: <20220322193813.677697-1-tyreld@linux.ibm.com> (raw)

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


                 reply	other threads:[~2022-03-22 19:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220322193813.677697-1-tyreld@linux.ibm.com \
    --to=tyreld@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefani@seibold.net \
    --cc=torvlds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®