From: Matt Mackall Add rol32 and ror32 bitops to bitops.h Signed-off-by: Matt Mackall Signed-off-by: Andrew Morton --- 25-akpm/drivers/char/random.c | 5 ----- 25-akpm/include/linux/bitops.h | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff -puN drivers/char/random.c~random-pt4-create-new-rol32-ror32-bitops drivers/char/random.c --- 25/drivers/char/random.c~random-pt4-create-new-rol32-ror32-bitops 2005-01-22 23:48:09.508878016 -0800 +++ 25-akpm/drivers/char/random.c 2005-01-22 23:48:09.515876952 -0800 @@ -374,11 +374,6 @@ static struct poolinfo { static DECLARE_WAIT_QUEUE_HEAD(random_read_wait); static DECLARE_WAIT_QUEUE_HEAD(random_write_wait); -static inline __u32 rol32(__u32 word, int shift) -{ - return (word << shift) | (word >> (32 - shift)); -} - #if 0 static int debug = 0; module_param(debug, bool, 0644); diff -puN include/linux/bitops.h~random-pt4-create-new-rol32-ror32-bitops include/linux/bitops.h --- 25/include/linux/bitops.h~random-pt4-create-new-rol32-ror32-bitops 2005-01-22 23:48:09.510877712 -0800 +++ 25-akpm/include/linux/bitops.h 2005-01-22 23:48:09.516876800 -0800 @@ -134,4 +134,26 @@ static inline unsigned long hweight_long 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, int shift) +{ + return (word << shift) | (word >> (32 - shift)); +} + +/* + * ror32 - rotate a 32-bit value right + * + * @word: value to rotate + * @shift: bits to roll + */ +static inline __u32 ror32(__u32 word, int shift) +{ + return (word >> shift) | (word << (32 - shift)); +} + #endif _