From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by dpdk.org (Postfix) with ESMTP id 9DD1B2A9 for ; Thu, 25 Dec 2014 19:54:13 +0100 (CET) Received: by mail-pa0-f44.google.com with SMTP id et14so12159663pad.3 for ; Thu, 25 Dec 2014 10:54:12 -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 :cc:content-type; bh=SpHnO/Al9kRLyFc/DILpCCvIsLmyMbggDxrNhlO6THM=; b=BD/3JcBynAKdzUkOSN46/eCALisOsrtt8z4WimyaAAjL53Y4JMJL8VQTixnB3M9kDW VY6IyDBsoH7IJ24UmyJX76q5WnwIZv/QqNnLUJa12y0gTH9pOX2fBNp/kq8kZcExvnMT 5YFlReaTB6KKIH3qCb1Ydee9ga51vmzFNDTniENbFvHNzR39im7EN0pCl2/DVDPhlfvW n1ixsRvfHjLn+PC/6V6SVd59Yc+b3NEkOqECznbmafawTI55+1qmhsiG287DoVCEa29N znB2MIbgIZxrLWwloSssP3zwmv1NFF/Wt0i6LeQPwx/xknt0Ir/G5PuCb5bI18i7Aiaj BwFA== MIME-Version: 1.0 X-Received: by 10.68.194.106 with SMTP id hv10mr60992633pbc.50.1419533652797; Thu, 25 Dec 2014 10:54:12 -0800 (PST) Received: by 10.70.114.233 with HTTP; Thu, 25 Dec 2014 10:54:12 -0800 (PST) In-Reply-To: <20141225172144.GC3199@localhost.localdomain> References: <1419521597-31978-1-git-send-email-rkerur@gmail.com> <1419521597-31978-2-git-send-email-rkerur@gmail.com> <20141225172144.GC3199@localhost.localdomain> Date: Thu, 25 Dec 2014 10:54:12 -0800 Message-ID: From: Ravi Kerur To: Neil Horman Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 1/7] Fix rte_is_power_of_2 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: Thu, 25 Dec 2014 18:54:13 -0000 Sure, will post it separately. Thanks. On Thu, Dec 25, 2014 at 9:21 AM, Neil Horman wrote: > On Thu, Dec 25, 2014 at 10:33:11AM -0500, Ravi Kerur wrote: > > rte_is_power_of_2 returns true for 0 and 0 is not power_of_2. Fix > > by checking for n. > > > > Signed-off-by: Ravi Kerur > > --- > > lib/librte_eal/common/include/rte_common.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/lib/librte_eal/common/include/rte_common.h > b/lib/librte_eal/common/include/rte_common.h > > index 921b91f..8ac940c 100644 > > --- 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) > > { > > - return ((n-1) & n) == 0; > > + return n && !(n & (n - 1)); > > } > > > > /** > > -- > > 1.9.1 > > > > > > This is the third time you've tried to slip this change in with some larger > changeset. I'm in favor of it, but please, stop trying to bury stuff in > other, > larger changesets. Its a legitimate bug, you can just post this on its > own. > > Neil > >