Skip to contentSkip to conversation

Simple fix in rte_is_power_of_2 and RTE_MIN/RTE_MAX

PATCH New r k 1 participant 1 message Dec 10, 2014 3 messages not in the archive

lore
Share & tools
lore

r k

author
#3 lore raw

PATCH 1/1 Simple fix in rte_is_power_of_2 and RTE_MIN/RTE_MAX

In reply to a message not in the archive

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