From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id A64381B24E; Thu, 12 Oct 2017 21:28:11 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Oct 2017 12:28:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,367,1503385200"; d="scan'208";a="909388936" Received: from unknown (HELO [10.241.225.21]) ([10.241.225.21]) by FMSMGA003.fm.intel.com with ESMTP; 12 Oct 2017 12:28:09 -0700 To: Michal Jastrzebski , jingjing.wu@intel.com Cc: dev@dpdk.org, deepak.k.jain@intel.com, Tomasz Kulasek , andrey.chilikin@intel.com, stable@dpdk.org References: <20170929125656.33164-1-michalx.k.jastrzebski@intel.com> From: Ferruh Yigit Message-ID: <731b3c79-33e8-5a1e-1f2e-71d3b8011ce1@intel.com> Date: Thu, 12 Oct 2017 20:28:09 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20170929125656.33164-1-michalx.k.jastrzebski@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH] app/testpmd: fix runtime dead code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 19:28:14 -0000 On 9/29/2017 1:56 PM, Michal Jastrzebski wrote: > From: Tomasz Kulasek > > Coverity reports DEADCODE, as assumes that RTE_LIBRTE_I40E_PMD > is defined and function compiles entirely. > The fix is about to place printf function into #else branch > of conditional compilation, since it is known at compile > time if i40e is supported. No need to check it at runtime. This is to highlight this is not supported other than defined PMD, and used like this in similar functions, I am for keeping this and marking coverity item as false positive. Hi Jingjing, What do you think, if you have strong opinion to get this, I will. Thanks, ferruh > > Coverity issue: 158646 > Fixes: 37a56cce7b8e ("app/testpmd: enable DDP get info feature") > Cc: andrey.chilikin@intel.com > Cc: stable@dpdk.org > > Signed-off-by: Tomasz Kulasek > --- > app/test-pmd/cmdline.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index ccdf239..c604dac 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -13414,8 +13414,8 @@ struct cmd_ddp_info_result { > struct cmd_ddp_info_result *res = parsed_result; > uint8_t *pkg; > uint32_t pkg_size; > - int ret = -ENOTSUP; > #ifdef RTE_LIBRTE_I40E_PMD > + int ret; > uint32_t i; > uint8_t *buff; > uint32_t buff_size; > @@ -13495,10 +13495,9 @@ struct cmd_ddp_info_result { > free(devs); > } > } > - ret = 0; > +#else > + printf("Function not supported in PMD driver\n"); > #endif > - if (ret == -ENOTSUP) > - printf("Function not supported in PMD driver\n"); > close_ddp_package_file(pkg); > } > >