diff options
| author | Ingo Molnar <mingo@kernel.org> | 2016-07-08 11:51:28 +0200 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2016-07-08 11:51:28 +0200 |
| commit | 946e0f6ffcaa614012d646f4cf84efdd62628c8b (patch) | |
| tree | 37d31fd748f98ec4fb7897997a2745228bf0c2da /include/linux/bitops.h | |
| parent | 67d7a982bab6702d84415ea889996fae72a7d3b2 (diff) | |
| parent | a99cde438de0c4c0cecc1d1af1a55a75b10bfdef (diff) | |
Merge tag 'v4.7-rc6' into x86/mm, to merge fixes before applying new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/bitops.h')
| -rw-r--r-- | include/linux/bitops.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index defeaac0745f..299e76b59fe9 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -227,6 +227,22 @@ static inline unsigned long __ffs64(u64 word) }) #endif +#ifndef bit_clear_unless +#define bit_clear_unless(ptr, _clear, _test) \ +({ \ + const typeof(*ptr) clear = (_clear), test = (_test); \ + typeof(*ptr) old, new; \ + \ + do { \ + old = ACCESS_ONCE(*ptr); \ + new = old & ~clear; \ + } while (!(old & test) && \ + cmpxchg(ptr, old, new) != old); \ + \ + !(old & test); \ +}) +#endif + #ifndef find_last_bit /** * find_last_bit - find the last set bit in a memory region |
