util: make is_power_of_two() a public utility
Somewhat useful utility that should only have one implementation, so it can impede on the normally-available application namespace. Change-Id: I085850177c231fdf58634f97e897c4d2e1a5cffb Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
parent
0dcad8331b
commit
4dca2dfad3
2 changed files with 2 additions and 2 deletions
|
@ -83,7 +83,7 @@ void _ScbNumPriGroupSet(unsigned int n /* number of priorities */
|
|||
unsigned int set;
|
||||
union __aircr reg;
|
||||
|
||||
__ASSERT(_IsPowerOfTwo(n) && (n <= 128),
|
||||
__ASSERT(is_power_of_two(n) && (n <= 128),
|
||||
"invalid number of priorities");
|
||||
|
||||
set = find_lsb_set(n);
|
||||
|
|
|
@ -68,7 +68,7 @@ extern "C" {
|
|||
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
static inline int _IsPowerOfTwo(unsigned int x)
|
||||
static inline int is_power_of_two(unsigned int x)
|
||||
{
|
||||
return (x != 0) && !(x & (x - 1));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue