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:
Benjamin Walsh 2015-08-20 13:56:10 -04:00 committed by Anas Nashif
commit 4dca2dfad3
2 changed files with 2 additions and 2 deletions

View file

@ -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);

View file

@ -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));
}