diff options
| author | 2014-05-06 20:37:42 +0300 | |
|---|---|---|
| committer | 2014-05-06 20:37:42 +0300 | |
| commit | cebeb0f1885fa93c44be5d4e0b9b640210ff088c (patch) | |
| tree | a33e4af4ddaa7a57f997ab9a2baceb48209670cd /include/linux/bitops.h | |
| parent | Merge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next (diff) | |
| parent | rsi: Changing opcode for sta mode according to changes in firmware (diff) | |
Merge remote-tracking branch 'wireless-next/master' into iwlwifi-next
Diffstat (limited to 'include/linux/bitops.h')
| -rw-r--r-- | include/linux/bitops.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index abc9ca778456..be5fd38bd5a0 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -196,6 +196,21 @@ static inline unsigned long __ffs64(u64 word) #ifdef __KERNEL__ +#ifndef set_mask_bits +#define set_mask_bits(ptr, _mask, _bits) \ +({ \ + const typeof(*ptr) mask = (_mask), bits = (_bits); \ + typeof(*ptr) old, new; \ + \ + do { \ + old = ACCESS_ONCE(*ptr); \ + new = (old & ~mask) | bits; \ + } while (cmpxchg(ptr, old, new) != old); \ + \ + new; \ +}) +#endif + #ifndef find_last_bit /** * find_last_bit - find the last set bit in a memory region |
