diff options
| author | Tom Rini <[email protected]> | 2026-01-05 15:12:02 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-01-05 15:12:02 -0600 |
| commit | c344087025a4c296468a1d5aeb61078a58baa59e (patch) | |
| tree | f5a7ba04c352b3e3cb79065096ea43480f7bda2f /include/linux | |
| parent | 127a42c7257a6ffbbd1575ed1cbaa8f5408a44b3 (diff) | |
| parent | 6cdd7597a2fbfc1572c1b0af23d3daf1cefa2de7 (diff) | |
Merge branch 'next'
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bitops.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index f826d7f3b34..29e0da48de8 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -148,6 +148,17 @@ static inline unsigned long hweight_long(unsigned long w) return sizeof(w) == 4 ? generic_hweight32(w) : generic_hweight64(w); } +/** + * 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 & 31)) | (word >> ((-shift) & 31)); +} + #include <asm/bitops.h> /* linux/include/asm-generic/bitops/non-atomic.h */ |
