lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c2a93f172366696fcebf9ef421ff29abfa4ebd0f.1744923838.git.christophe.jaillet@wanadoo.fr>
Date: Thu, 17 Apr 2025 23:04:34 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Stefani Seibold <stefani@...bold.net>
Cc: linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org,
	Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH 2/3] kfifo: Fix the description of kfifo_init()

Remove a useless comment related to kfifo_init().

The size of the buffer is expected to be a power of 2, as already stated a
few liens above.

There is no point is speaking of "the number of elements" here. If
kfifo_init() is used, then the internal buffer is explicitly allocated
using a memory allocation function such a kvalloc() and the needed context
is stored in a struct kfifo. In such a case, the "size" of an element is
defined a sizeof(unsigned char) which is 1.

Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
 include/linux/kfifo.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index 54fbe2ae6fbd..707dd90138d2 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -389,7 +389,6 @@ __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.
  * Return 0 if no error, otherwise an error code.
  */
 #define kfifo_init(fifo, buffer, size) \
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ