DPDK patches and discussions
 help / color / mirror / Atom feed
From: r k <rkerur@gmail.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH] Simple fix in rte_is_power_of_2 and RTE_MIN/RTE_MAX
Date: Wed, 10 Dec 2014 08:45:30 -0800
Message-ID: <CAFb4SLDCysJhzhqUtiFpbQfxtRjaNs_YULbHV_92WsB6NxED8A@mail.gmail.com> (raw)
In-Reply-To: <EDD8E64855FBDA45ACDFE02112E795B70DC85350FD@HQ1-EXCH03.corp.brocade.com>

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(-)


           reply	other threads:[~2014-12-10 16:45 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <EDD8E64855FBDA45ACDFE02112E795B70DC85350FD@HQ1-EXCH03.corp.brocade.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFb4SLDCysJhzhqUtiFpbQfxtRjaNs_YULbHV_92WsB6NxED8A@mail.gmail.com \
    --to=rkerur@gmail.com \
    --cc=dev@dpdk.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git