Message ID | 1468315825-24089-1-git-send-email-maxime.coquelin@redhat.com (mailing list archive) |
---|---|
State | Accepted, 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 760C4F94; Tue, 12 Jul 2016 11:30:43 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 6A71CF94 for <dev@dpdk.org>; Tue, 12 Jul 2016 11:30:42 +0200 (CEST) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BC63D80E47; Tue, 12 Jul 2016 09:30:41 +0000 (UTC) Received: from max-t460s.redhat.com (vpn-202-34.tlv.redhat.com [10.35.202.34]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6C9UcPY014292; Tue, 12 Jul 2016 05:30:39 -0400 From: Maxime Coquelin <maxime.coquelin@redhat.com> To: huawei.xie@intel.com, yuanhan.liu@linux.intel.com Cc: dev@dpdk.org, Maxime Coquelin <maxime.coquelin@redhat.com>, Jianfeng Tan <jianfeng.tan@intel.com> Date: Tue, 12 Jul 2016 11:30:25 +0200 Message-Id: <1468315825-24089-1-git-send-email-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 12 Jul 2016 09:30:41 +0000 (UTC) Subject: [dpdk-dev] [PATCH] net/virtio-user: Fix missing brackets in if condition 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
Maxime Coquelin
July 12, 2016, 9:30 a.m. UTC
The error is reported using test build script:
$ scripts/test-build.sh x86_64-native-linuxapp-gcc
...
drivers/net/virtio/virtio_user_ethdev.c: In function ‘virtio_user_pmd_devinit’:
drivers/net/virtio/virtio_user_ethdev.c:345:2: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PATH) == 1)
^~
Fixes: 404bd6bfe360 ("net/virtio-user: fix return value not checked")
Cc: Jianfeng Tan <jianfeng.tan@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
drivers/net/virtio/virtio_user_ethdev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hi, 2016-07-12 11:30, Maxime Coquelin: > The error is reported using test build script: > > $ scripts/test-build.sh x86_64-native-linuxapp-gcc > ... > drivers/net/virtio/virtio_user_ethdev.c: In function ‘virtio_user_pmd_devinit’: > drivers/net/virtio/virtio_user_ethdev.c:345:2: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] Are you using gcc 6 ?
On 07/12/2016 11:35 AM, Thomas Monjalon wrote: > Hi, > > 2016-07-12 11:30, Maxime Coquelin: >> The error is reported using test build script: >> >> $ scripts/test-build.sh x86_64-native-linuxapp-gcc >> ... >> drivers/net/virtio/virtio_user_ethdev.c: In function ‘virtio_user_pmd_devinit’: >> drivers/net/virtio/virtio_user_ethdev.c:345:2: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] > Are you using gcc 6 ? Yes: $ gcc --version gcc (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3)
On Tue, Jul 12, 2016 at 11:30:25AM +0200, Maxime Coquelin wrote: > The error is reported using test build script: > > $ scripts/test-build.sh x86_64-native-linuxapp-gcc > ... > drivers/net/virtio/virtio_user_ethdev.c: In function ‘virtio_user_pmd_devinit’: > drivers/net/virtio/virtio_user_ethdev.c:345:2: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] > if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PATH) == 1) > ^~ > > Fixes: 404bd6bfe360 ("net/virtio-user: fix return value not checked") > > Cc: Jianfeng Tan <jianfeng.tan@intel.com> > Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Thanks for the fix. --yliu
On Tue, 12 Jul 2016 11:30:25 +0200 Maxime Coquelin <maxime.coquelin@redhat.com> wrote: > The error is reported using test build script: I recommend to note that the error is reported only by GCC 6+. > > $ scripts/test-build.sh x86_64-native-linuxapp-gcc > ... > drivers/net/virtio/virtio_user_ethdev.c: In function ‘virtio_user_pmd_devinit’: > drivers/net/virtio/virtio_user_ethdev.c:345:2: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] > if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PATH) == 1) > ^~ > > Fixes: 404bd6bfe360 ("net/virtio-user: fix return value not checked") > > Cc: Jianfeng Tan <jianfeng.tan@intel.com> > Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> > Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> > Reviewed-by: Jan Viktorin <viktorin@rehivetech.com>
On Thu, Jul 14, 2016 at 06:31:11PM +0200, viktorin@rehivetech.com wrote: > On Tue, 12 Jul 2016 11:30:25 +0200 > Maxime Coquelin <maxime.coquelin@redhat.com> wrote: > > > The error is reported using test build script: > > I recommend to note that the error is reported only by GCC 6+. Agreed! --yliu > > > > > $ scripts/test-build.sh x86_64-native-linuxapp-gcc > > ... > > drivers/net/virtio/virtio_user_ethdev.c: In function ‘virtio_user_pmd_devinit’: > > drivers/net/virtio/virtio_user_ethdev.c:345:2: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] > > if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PATH) == 1) > > ^~ > > > > Fixes: 404bd6bfe360 ("net/virtio-user: fix return value not checked") > > > > Cc: Jianfeng Tan <jianfeng.tan@intel.com> > > Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> > > Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> > > > Reviewed-by: Jan Viktorin <viktorin@rehivetech.com>
2016-07-12 20:11, Yuanhan Liu: > On Tue, Jul 12, 2016 at 11:30:25AM +0200, Maxime Coquelin wrote: > > The error is reported using test build script: > > > > $ scripts/test-build.sh x86_64-native-linuxapp-gcc > > ... > > drivers/net/virtio/virtio_user_ethdev.c: In function ‘virtio_user_pmd_devinit’: > > drivers/net/virtio/virtio_user_ethdev.c:345:2: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] > > if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PATH) == 1) > > ^~ > > > > Fixes: 404bd6bfe360 ("net/virtio-user: fix return value not checked") > > > > Cc: Jianfeng Tan <jianfeng.tan@intel.com> > > Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com> > > Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> > > Thanks for the fix. Applied, thanks
diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index 782d7d3..6b4f66e 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -342,7 +342,7 @@ virtio_user_pmd_devinit(const char *name, const char *params) goto end; } - if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PATH) == 1) + if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_PATH) == 1) { ret = rte_kvargs_process(kvlist, VIRTIO_USER_ARG_PATH, &get_string_arg, &path); if (ret < 0) { @@ -350,7 +350,7 @@ virtio_user_pmd_devinit(const char *name, const char *params) VIRTIO_USER_ARG_PATH); goto end; } - else { + } else { PMD_INIT_LOG(ERR, "arg %s is mandatory for virtio-user\n", VIRTIO_USER_ARG_QUEUE_SIZE); goto end;