From patchwork Fri Sep 29 12:56:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Jastrzebski X-Patchwork-Id: 29432 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 516F35598; Fri, 29 Sep 2017 14:58:31 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 793985592; Fri, 29 Sep 2017 14:58:29 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP; 29 Sep 2017 05:58:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.42,452,1500966000"; d="scan'208"; a="1177009735" Received: from unknown ([10.103.103.177]) by orsmga001.jf.intel.com with SMTP; 29 Sep 2017 05:58:25 -0700 Received: by (sSMTP sendmail emulation); Fri, 29 Sep 2017 14:57:00 +0200 From: Michal Jastrzebski To: jingjing.wu@intel.com Cc: dev@dpdk.org, deepak.k.jain@intel.com, Tomasz Kulasek , andrey.chilikin@intel.com, stable@dpdk.org Date: Fri, 29 Sep 2017 14:56:56 +0200 Message-Id: <20170929125656.33164-1-michalx.k.jastrzebski@intel.com> X-Mailer: git-send-email 2.12.2 Subject: [dpdk-dev] [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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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. 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 Acked-by: Jingjing Wu --- 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); }