Message ID | a90ae275e7fc4bac15fcef89119accdf1821b552.1424341431.git.pmatilai@redhat.com (mailing list archive) |
---|---|
State | Changes Requested, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id C270FB548; Thu, 19 Feb 2015 11:25:17 +0100 (CET) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 95051B4FA for <dev@dpdk.org>; Thu, 19 Feb 2015 11:25:15 +0100 (CET) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1JAPEDb001198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for <dev@dpdk.org>; Thu, 19 Feb 2015 05:25:14 -0500 Received: from localhost.localdomain.com (vpn1-6-118.ams2.redhat.com [10.36.6.118]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t1JAPD4q002807 for <dev@dpdk.org>; Thu, 19 Feb 2015 05:25:13 -0500 From: Panu Matilainen <pmatilai@redhat.com> To: dev@dpdk.org Date: Thu, 19 Feb 2015 12:25:06 +0200 Message-Id: <a90ae275e7fc4bac15fcef89119accdf1821b552.1424341431.git.pmatilai@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Subject: [dpdk-dev] [PATCH] ixgbe: fix build with gcc 5 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Panu Matilainen
Feb. 19, 2015, 10:25 a.m. UTC
Add extra parenthesis to remove ambiguity on what we want to compare,
otherwise gcc 5 issues a "logical not is only applied to the left hand
side of comparison" warning which with -Werror fails the build.
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
---
lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hi Panu, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Panu Matilainen > Sent: Thursday, February 19, 2015 10:25 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] ixgbe: fix build with gcc 5 > > Add extra parenthesis to remove ambiguity on what we want to compare, > otherwise gcc 5 issues a "logical not is only applied to the left hand > side of comparison" warning which with -Werror fails the build. > > Signed-off-by: Panu Matilainen <pmatilai@redhat.com> > --- > lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c > index 37e5bae..93a6a00 100644 > --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c > +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c > @@ -2898,8 +2898,8 @@ STATIC s32 ixgbe_fc_autoneg_fiber(struct ixgbe_hw *hw) > */ > > linkstat = IXGBE_READ_REG(hw, IXGBE_PCS1GLSTA); > - if ((!!(linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE) == 0) || > - (!!(linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT) == 1)) { > + if (((!!(linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE)) == 0) || > + ((!!(linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT)) == 1)) { > ERROR_REPORT1(IXGBE_ERROR_POLLING, > "Auto-Negotiation did not complete or timed out"); > goto out; Unfortunately we are not supposed to change files under ixgbe subfirectory (except ixgbe_osdep.*). Usually we deal with it just by: If GCC_VERSION... CFLAGS_ixgbe_common.o += -Wno... You can have a look at lib/librte_pmd_ixgbe/Makefile, there are plenty of such things. Konstantin > -- > 2.1.0
On 02/19/2015 02:02 PM, Ananyev, Konstantin wrote: > Hi Panu, > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Panu Matilainen >> Sent: Thursday, February 19, 2015 10:25 AM >> To: dev@dpdk.org >> Subject: [dpdk-dev] [PATCH] ixgbe: fix build with gcc 5 >> >> Add extra parenthesis to remove ambiguity on what we want to compare, >> otherwise gcc 5 issues a "logical not is only applied to the left hand >> side of comparison" warning which with -Werror fails the build. >> >> Signed-off-by: Panu Matilainen <pmatilai@redhat.com> >> --- >> lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c >> index 37e5bae..93a6a00 100644 >> --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c >> +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c >> @@ -2898,8 +2898,8 @@ STATIC s32 ixgbe_fc_autoneg_fiber(struct ixgbe_hw *hw) >> */ >> >> linkstat = IXGBE_READ_REG(hw, IXGBE_PCS1GLSTA); >> - if ((!!(linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE) == 0) || >> - (!!(linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT) == 1)) { >> + if (((!!(linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE)) == 0) || >> + ((!!(linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT)) == 1)) { >> ERROR_REPORT1(IXGBE_ERROR_POLLING, >> "Auto-Negotiation did not complete or timed out"); >> goto out; > > Unfortunately we are not supposed to change files under ixgbe subfirectory (except ixgbe_osdep.*). Oh, sorry about that, I didn't realize there were untouchable files in the repo. Its not a very common setup :) > Usually we deal with it just by: > If GCC_VERSION... > CFLAGS_ixgbe_common.o += -Wno... > > You can have a look at lib/librte_pmd_ixgbe/Makefile, there are plenty of such things. Yup, noticed that but assumed the warning disablers were mainly for things that are not trivial to fix. This one can be worked around just as easily with -Wlogical-not-parentheses, but since this flag is new to gcc 5 it can't really be added until gcc 5 is recognized as a supported version by the makefiles: http://dpdk.org/dev/patchwork/patch/3452/ I'll send an updated version using warning disabler once other gcc-5 support goes in. - Panu -
On Thu, Feb 19, 2015 at 12:02:06PM +0000, Ananyev, Konstantin wrote: > Hi Panu, > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Panu Matilainen > > Sent: Thursday, February 19, 2015 10:25 AM > > To: dev@dpdk.org > > Subject: [dpdk-dev] [PATCH] ixgbe: fix build with gcc 5 > > > > Add extra parenthesis to remove ambiguity on what we want to compare, > > otherwise gcc 5 issues a "logical not is only applied to the left hand > > side of comparison" warning which with -Werror fails the build. > > > > Signed-off-by: Panu Matilainen <pmatilai@redhat.com> > > --- > > lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c > > index 37e5bae..93a6a00 100644 > > --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c > > +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c > > @@ -2898,8 +2898,8 @@ STATIC s32 ixgbe_fc_autoneg_fiber(struct ixgbe_hw *hw) > > */ > > > > linkstat = IXGBE_READ_REG(hw, IXGBE_PCS1GLSTA); > > - if ((!!(linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE) == 0) || > > - (!!(linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT) == 1)) { > > + if (((!!(linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE)) == 0) || > > + ((!!(linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT)) == 1)) { > > ERROR_REPORT1(IXGBE_ERROR_POLLING, > > "Auto-Negotiation did not complete or timed out"); > > goto out; > > Unfortunately we are not supposed to change files under ixgbe subfirectory (except ixgbe_osdep.*). > Usually we deal with it just by: > If GCC_VERSION... > CFLAGS_ixgbe_common.o += -Wno... > Why don't you just send a patch to the netdev list to fix ixgbe in the linux tree, and then apply the same patch once it gets accepted. Then the merge will go smoothly when it comes down. That would be much better than doing GCC version ifdeffery. Neil > You can have a look at lib/librte_pmd_ixgbe/Makefile, there are plenty of such things. > Konstantin > > > > -- > > 2.1.0 > >
diff --git a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c index 37e5bae..93a6a00 100644 --- a/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c +++ b/lib/librte_pmd_ixgbe/ixgbe/ixgbe_common.c @@ -2898,8 +2898,8 @@ STATIC s32 ixgbe_fc_autoneg_fiber(struct ixgbe_hw *hw) */ linkstat = IXGBE_READ_REG(hw, IXGBE_PCS1GLSTA); - if ((!!(linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE) == 0) || - (!!(linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT) == 1)) { + if (((!!(linkstat & IXGBE_PCS1GLSTA_AN_COMPLETE)) == 0) || + ((!!(linkstat & IXGBE_PCS1GLSTA_AN_TIMED_OUT)) == 1)) { ERROR_REPORT1(IXGBE_ERROR_POLLING, "Auto-Negotiation did not complete or timed out"); goto out;