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>] [day] [month] [year] [list]
Message-Id: <20220710152119.3803-1-eddielin0926@gmail.com>
Date:   Sun, 10 Jul 2022 23:21:19 +0800
From:   Eddie Lin <eddielin0926@...il.com>
To:     arnd@...db.de
Cc:     rth@...ddle.net, ink@...assic.park.msu.ru, mattst88@...il.com,
        linux-alpha@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arch@...r.kernel.org, eddielin0926@...il.com
Subject: [PATCH] sched: fix comment for sched_find_first_bit()

The result of __ffs is undefined if the word is zero. Therefore, it
should be guaranteed that at least one of the 100 bits is set.

Signed-off-by: Eddie Lin <eddielin0926@...il.com>
---
 arch/alpha/include/asm/bitops.h    | 4 ++--
 include/asm-generic/bitops/sched.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h
index e1d8483a4..9af3528f5 100644
--- a/arch/alpha/include/asm/bitops.h
+++ b/arch/alpha/include/asm/bitops.h
@@ -434,8 +434,8 @@ static inline unsigned int __arch_hweight8(unsigned int w)
 
 /*
  * Every architecture must define this function. It's the fastest
- * way of searching a 100-bit bitmap.  It's guaranteed that at least
- * one of the 100 bits is cleared.
+ * way of searching a 100-bit bitmap. It's guaranteed that at least
+ * one of the 100 bits is set.
  */
 static inline unsigned long
 sched_find_first_bit(const unsigned long b[2])
diff --git a/include/asm-generic/bitops/sched.h b/include/asm-generic/bitops/sched.h
index 86470cfce..2b614eb40 100644
--- a/include/asm-generic/bitops/sched.h
+++ b/include/asm-generic/bitops/sched.h
@@ -7,8 +7,8 @@
 
 /*
  * Every architecture must define this function. It's the fastest
- * way of searching a 100-bit bitmap.  It's guaranteed that at least
- * one of the 100 bits is cleared.
+ * way of searching a 100-bit bitmap. It's guaranteed that at least
+ * one of the 100 bits is set.
  */
 static inline int sched_find_first_bit(const unsigned long *b)
 {
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ