diff options
| author | 2017-07-25 10:44:18 +1000 | |
|---|---|---|
| committer | 2017-07-25 10:44:18 +1000 | |
| commit | 53a2ebaaabc1eb8458796fec3bc1e0e80746b642 (patch) | |
| tree | 9d1f9227b49392cdd2edcc01057517da4f4b09c2 /tools/include/linux/bitops.h | |
| parent | LSM: Remove security_task_create() hook. (diff) | |
| parent | Linux 4.13-rc2 (diff) | |
sync to Linus v4.13-rc2 for subsystem developers to work against
Diffstat (limited to 'tools/include/linux/bitops.h')
| -rw-r--r-- | tools/include/linux/bitops.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/include/linux/bitops.h b/tools/include/linux/bitops.h index 1aecad369af5..969db1981868 100644 --- a/tools/include/linux/bitops.h +++ b/tools/include/linux/bitops.h @@ -61,4 +61,14 @@ static inline unsigned fls_long(unsigned long l) return fls64(l); } +/** + * rol32 - rotate a 32-bit value left + * @word: value to rotate + * @shift: bits to roll + */ +static inline __u32 rol32(__u32 word, unsigned int shift) +{ + return (word << shift) | (word >> ((-shift) & 31)); +} + #endif |
