aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bitops.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-02-18 18:24:05 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-02-18 18:24:05 -0500
commita18d3afefa0104419b5e069af5922bb57a302426 (patch)
tree4bcc6010e2eb46d5d40454c4c9276f1ec6c7fd73 /include/linux/bitops.h
parent34ddc81a230b15c0e345b6b253049db731499f7e (diff)
parentf2ea0f5f04c97b48c88edccba52b0682fbe45087 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: sha512 - use standard ror64()
Diffstat (limited to 'include/linux/bitops.h')
-rw-r--r--include/linux/bitops.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 3c1063acb2ab..94300fe46cce 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -56,6 +56,26 @@ static inline unsigned long hweight_long(unsigned long w)
56} 56}
57 57
58/** 58/**
59 * rol64 - rotate a 64-bit value left
60 * @word: value to rotate
61 * @shift: bits to roll
62 */
63static inline __u64 rol64(__u64 word, unsigned int shift)
64{
65 return (word << shift) | (word >> (64 - shift));
66}
67
68/**
69 * ror64 - rotate a 64-bit value right
70 * @word: value to rotate
71 * @shift: bits to roll
72 */
73static inline __u64 ror64(__u64 word, unsigned int shift)
74{
75 return (word >> shift) | (word << (64 - shift));
76}
77
78/**
59 * rol32 - rotate a 32-bit value left 79 * rol32 - rotate a 32-bit value left
60 * @word: value to rotate 80 * @word: value to rotate
61 * @shift: bits to roll 81 * @shift: bits to roll