diff options
Diffstat (limited to 'include/linux/bitops.h')
-rw-r--r-- | include/linux/bitops.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 645fd2e6f6..eb5ff37f2f 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -2,7 +2,7 @@ #ifndef _LINUX_BITOPS_H #define _LINUX_BITOPS_H -#include <asm/types.h> +#include <linux/types.h> #ifdef __KERNEL__ #define BIT(nr) (1UL << (nr)) @@ -194,6 +194,20 @@ static inline unsigned long __ffs64(u64 word) return __ffs((unsigned long)word); } +/** + * assign_bit - Assign value to a bit in memory + * @nr: the bit to set + * @addr: the address to start counting from + * @value: the value to assign + */ +static inline void assign_bit(long nr, volatile unsigned long *addr, bool value) +{ + if (value) + set_bit(nr, addr); + else + clear_bit(nr, addr); +} + #ifdef __KERNEL__ #ifndef set_mask_bits |