[PATCH] bitops: Add a comment explaining the double underscore macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Walleij pointed out that a new comer might be confused about the
difference between set_bit() and __set_bit().  Add a comment explaining
the difference.

Link: https://lore.kernel.org/all/CACRpkdZFPG_YLici-BmYfk9HZ36f4WavCN3JNotkk8cPgCODCg@xxxxxxxxxxxxxx/
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
 include/linux/bitops.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 46d4bdc634c0..b35a5c3783f6 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -29,6 +29,9 @@ extern unsigned long __sw_hweight64(__u64 w);
 #include <asm-generic/bitops/generic-non-atomic.h>
 
 /*
+ * These double underscore __set_bit(), __clear_bit() macros are non-atomic
+ * versions of set_bit(), clear_bit() and so on.
+ *
  * Many architecture-specific non-atomic bitops contain inline asm code and due
  * to that the compiler can't optimize them to compile-time expressions or
  * constants. In contrary, generic_*() helpers are defined in pure C and
-- 
2.39.2





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux