git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
eal: fix check for power of 2 in 0 case
[dpdk.git]
/
lib
/
librte_eal
/
common
/
include
/
rte_common.h
diff --git
a/lib/librte_eal/common/include/rte_common.h
b/lib/librte_eal/common/include/rte_common.h
index
921b91f
..
8ac940c
100644
(file)
--- a/
lib/librte_eal/common/include/rte_common.h
+++ b/
lib/librte_eal/common/include/rte_common.h
@@
-203,7
+203,7
@@
extern int RTE_BUILD_BUG_ON_detected_error;
static inline int
rte_is_power_of_2(uint32_t n)
{
static inline int
rte_is_power_of_2(uint32_t n)
{
- return
((n-1) & n) == 0
;
+ return
n && !(n & (n - 1))
;
}
/**
}
/**