mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sched: fix comment for sched_find_first_bit()
@ 2022-07-10 15:21 Eddie Lin
  0 siblings, 0 replies; only message in thread
From: Eddie Lin @ 2022-07-10 15:21 UTC (permalink / raw)
  To: arnd
  Cc: rth, ink, mattst88, linux-alpha, linux-kernel, linux-arch, eddielin0926

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@gmail.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


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

only message in thread, other threads:[~2022-07-10 15:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-10 15:21 [PATCH] sched: fix comment for sched_find_first_bit() Eddie Lin

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®