DPDK patches and discussions
 help / color / mirror / Atom feed
From: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>
To: jingjing.wu@intel.com
Cc: dev@dpdk.org, deepak.k.jain@intel.com,
	Tomasz Kulasek <tomaszx.kulasek@intel.com>,
	andrey.chilikin@intel.com, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] app/testpmd: fix runtime dead code
Date: Fri, 29 Sep 2017 14:56:56 +0200	[thread overview]
Message-ID: <20170929125656.33164-1-michalx.k.jastrzebski@intel.com> (raw)

From: Tomasz Kulasek <tomaszx.kulasek@intel.com>

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 <tomaszx.kulasek@intel.com>
---
 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);
 }
 
-- 
1.9.1

             reply	other threads:[~2017-09-29 12:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-29 12:56 Michal Jastrzebski [this message]
2017-09-29 14:25 ` Wu, Jingjing
2017-10-12 19:28 ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2017-10-13  1:36   ` Wu, Jingjing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170929125656.33164-1-michalx.k.jastrzebski@intel.com \
    --to=michalx.k.jastrzebski@intel.com \
    --cc=andrey.chilikin@intel.com \
    --cc=deepak.k.jain@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=stable@dpdk.org \
    --cc=tomaszx.kulasek@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).