diff options
| author | 2012-02-19 16:03:15 -0500 | |
|---|---|---|
| committer | 2012-02-19 16:03:15 -0500 | |
| commit | 32efe08d77f5902ce7315fc9003c010ffffb8268 (patch) | |
| tree | 40a88e6bae4e797cafce33f16a25e350c038f9bb /include/linux/bitops.h | |
| parent | cisco/enic: use eth_hw_addr_random() instead of random_ether_addr() (diff) | |
| parent | Linux 3.3-rc4 (diff) | |
| download | wireguard-linux-32efe08d77f5902ce7315fc9003c010ffffb8268.tar.xz wireguard-linux-32efe08d77f5902ce7315fc9003c010ffffb8268.zip | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
Small minor conflict in bnx2x, wherein one commit changed how
statistics were stored in software, and another commit
fixed endianness bugs wrt. reading the values provided by
the chip in memory.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/bitops.h')
| -rw-r--r-- | include/linux/bitops.h | 20 |
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) } /** + * rol64 - rotate a 64-bit value left + * @word: value to rotate + * @shift: bits to roll + */ +static inline __u64 rol64(__u64 word, unsigned int shift) +{ + return (word << shift) | (word >> (64 - shift)); +} + +/** + * ror64 - rotate a 64-bit value right + * @word: value to rotate + * @shift: bits to roll + */ +static inline __u64 ror64(__u64 word, unsigned int shift) +{ + return (word >> shift) | (word << (64 - shift)); +} + +/** * rol32 - rotate a 32-bit value left * @word: value to rotate * @shift: bits to roll |
