Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23588
b: refs/heads/master
c: 962749a
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Mar 25, 2006
1 parent bb7644d commit 57cf242
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 231bed205879236357171e50bd8965e70797ecdc
refs/heads/master: 962749af67b145c57917bfbff3c303ebd7d5988c
7 changes: 7 additions & 0 deletions trunk/include/linux/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,11 @@ static inline __u32 ror32(__u32 word, unsigned int shift)
return (word >> shift) | (word << (32 - shift));
}

static inline unsigned fls_long(unsigned long l)
{
if (sizeof(l) == 4)
return fls(l);
return fls64(l);
}

#endif
5 changes: 3 additions & 2 deletions trunk/include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ static inline int __attribute_pure__ long_log2(unsigned long x)
return r;
}

static inline unsigned long __attribute_const__ roundup_pow_of_two(unsigned long x)
static inline unsigned long
__attribute_const__ roundup_pow_of_two(unsigned long x)
{
return (1UL << fls(x - 1));
return 1UL << fls_long(x - 1);
}

extern int printk_ratelimit(void);
Expand Down

0 comments on commit 57cf242

Please sign in to comment.