[dpdk-dev] [PATCH] Simple fix in rte_is_power_of_2 and RTE_MIN/RTE_MAX

r k rkerur at gmail.com
Wed Dec 10 17:45:30 CET 2014


Subject: [PATCH] Simple fix in rte_is_power_of_2 and RTE_MIN/RTE_MAX

Number 0 is not a power_of_2, fix it in rte_is_power_of_2 function.
Avoid code which generates branching when calculating min and max.

Ravi Kerur (1):
  Fix rte_is_power_of_2() function since it returns true for zero and
     zero is not a power of 2.     Avoid branching in RTE_MIN and
    RTE_MAX when calculating     minimum and maximum of two numbers.

 lib/librte_eal/common/include/rte_common.h | 6 +++---
 lib/librte_pmd_e1000/igb_pf.c              | 4 ++--
 lib/librte_pmd_ixgbe/ixgbe_pf.c            | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

--
1.9.1


More information about the dev mailing list