Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83414
b: refs/heads/master
c: de9330d
h: refs/heads/master
v: v3
  • Loading branch information
Robert P. J. Day authored and Linus Torvalds committed Feb 6, 2008
1 parent 742872d commit 90a684d
Show file tree
Hide file tree
Showing 2 changed files with 17 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: 582539e5a0480f1e00e3b9ffbe50bd5b2f59a16f
refs/heads/master: de9330d13eac1f331e63ab1d18c506365b0151f3
16 changes: 16 additions & 0 deletions trunk/include/linux/log2.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,20 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
__rounddown_pow_of_two(n) \
)

/**
* order_base_2 - calculate the (rounded up) base 2 order of the argument
* @n: parameter
*
* The first few values calculated by this routine:
* ob2(0) = 0
* ob2(1) = 0
* ob2(2) = 1
* ob2(3) = 2
* ob2(4) = 2
* ob2(5) = 3
* ... and so on.
*/

#define order_base_2(n) ilog2(roundup_pow_of_two(n))

#endif /* _LINUX_LOG2_H */

0 comments on commit 90a684d

Please sign in to comment.