Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87901
b: refs/heads/master
c: 3afe392
h: refs/heads/master
i:
  87899: a9c7362
v: v3
  • Loading branch information
Harvey Harrison authored and Linus Torvalds committed Mar 28, 2008
1 parent d0db95e commit 60d482b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 589499c04b9929ce3de9a9cc591f8a24cf1ebc91
refs/heads/master: 3afe3925987adc3fc052abe404e44520c2072fc8
40 changes: 40 additions & 0 deletions trunk/include/linux/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,46 @@ static inline __u32 ror32(__u32 word, unsigned int shift)
return (word >> shift) | (word << (32 - shift));
}

/**
* rol16 - rotate a 16-bit value left
* @word: value to rotate
* @shift: bits to roll
*/
static inline __u16 rol16(__u16 word, unsigned int shift)
{
return (word << shift) | (word >> (16 - shift));
}

/**
* ror16 - rotate a 16-bit value right
* @word: value to rotate
* @shift: bits to roll
*/
static inline __u16 ror16(__u16 word, unsigned int shift)
{
return (word >> shift) | (word << (16 - shift));
}

/**
* rol8 - rotate an 8-bit value left
* @word: value to rotate
* @shift: bits to roll
*/
static inline __u8 rol8(__u8 word, unsigned int shift)
{
return (word << shift) | (word >> (8 - shift));
}

/**
* ror8 - rotate an 8-bit value right
* @word: value to rotate
* @shift: bits to roll
*/
static inline __u8 ror8(__u8 word, unsigned int shift)
{
return (word >> shift) | (word << (8 - shift));
}

static inline unsigned fls_long(unsigned long l)
{
if (sizeof(l) == 4)
Expand Down

0 comments on commit 60d482b

Please sign in to comment.