hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/include/asm-generic/bitops/atomic.h
....@@ -11,19 +11,19 @@
1111 * See Documentation/atomic_bitops.txt for details.
1212 */
1313
14
-static inline void set_bit(unsigned int nr, volatile unsigned long *p)
14
+static __always_inline void set_bit(unsigned int nr, volatile unsigned long *p)
1515 {
1616 p += BIT_WORD(nr);
1717 atomic_long_or(BIT_MASK(nr), (atomic_long_t *)p);
1818 }
1919
20
-static inline void clear_bit(unsigned int nr, volatile unsigned long *p)
20
+static __always_inline void clear_bit(unsigned int nr, volatile unsigned long *p)
2121 {
2222 p += BIT_WORD(nr);
2323 atomic_long_andnot(BIT_MASK(nr), (atomic_long_t *)p);
2424 }
2525
26
-static inline void change_bit(unsigned int nr, volatile unsigned long *p)
26
+static __always_inline void change_bit(unsigned int nr, volatile unsigned long *p)
2727 {
2828 p += BIT_WORD(nr);
2929 atomic_long_xor(BIT_MASK(nr), (atomic_long_t *)p);
....@@ -35,9 +35,6 @@
3535 unsigned long mask = BIT_MASK(nr);
3636
3737 p += BIT_WORD(nr);
38
- if (READ_ONCE(*p) & mask)
39
- return 1;
40
-
4138 old = atomic_long_fetch_or(mask, (atomic_long_t *)p);
4239 return !!(old & mask);
4340 }
....@@ -48,9 +45,6 @@
4845 unsigned long mask = BIT_MASK(nr);
4946
5047 p += BIT_WORD(nr);
51
- if (!(READ_ONCE(*p) & mask))
52
- return 0;
53
-
5448 old = atomic_long_fetch_andnot(mask, (atomic_long_t *)p);
5549 return !!(old & mask);
5650 }