From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by dpdk.org (Postfix) with ESMTP id A54F56A8B for ; Wed, 10 Dec 2014 17:45:31 +0100 (CET) Received: by mail-pd0-f170.google.com with SMTP id v10so3106424pde.29 for ; Wed, 10 Dec 2014 08:45:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=kGqfUWf5Ip/FUITHOo2fPCREAjX/P9U8EDdCXn9W32s=; b=PM+0jOWHN45NML3XEzjhr+Xqkcf0317GxtOs9PtT40Aj/rwMaHimTVMnufn9IDEyn4 +27TcCMK4yIKhZQXYQquqRXUvzGdB3AtFeTtTlPVM2UYGlCfqIuw3l5VafDgWQu9smf6 To6+7jehnfjqP3b5cjLpdv7tS7l3/UPLy4uu6G8YFYdG2HpRQwI1do1/W4nMnVbiz2FE oWt58VIvHE7narBDdNRRpATm2+CjICpYKiDmaz+pQnLNOtdoylxT3WlNuq4C+DzRQQbh loEQ2I0eyzpmc+FM8L5Dh2bENjx/oKXT9uRHeKjBKQ0t1dQKYBcAqX8bcKQBKRNWsc8P kPLQ== MIME-Version: 1.0 X-Received: by 10.68.134.34 with SMTP id ph2mr8969726pbb.108.1418229930686; Wed, 10 Dec 2014 08:45:30 -0800 (PST) Received: by 10.70.70.40 with HTTP; Wed, 10 Dec 2014 08:45:30 -0800 (PST) In-Reply-To: References: <1418229688-4667-1-git-send-email-rkerur@gmail.com> Date: Wed, 10 Dec 2014 08:45:30 -0800 Message-ID: From: r k To: "dev@dpdk.org" Content-Type: text/plain; charset=UTF-8 Subject: [dpdk-dev] [PATCH] Simple fix in rte_is_power_of_2 and RTE_MIN/RTE_MAX X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2014 16:45:32 -0000 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