DPDK patches and discussions
 help / color / mirror / Atom feed
From: Artur Trybula <arturx.trybula@intel.com>
To: dev@dpdk.org, fiona.trahe@intel.com, adamx.dybkowski@intel.com,
	arturx.trybula@intel.com
Subject: [dpdk-dev] [PATCH v2 1/1] app/test-compress-perf: fix reliance on integer endianness
Date: Tue,  4 Jun 2019 14:41:01 +0200	[thread overview]
Message-ID: <20190604124101.28116-2-arturx.trybula@intel.com> (raw)
In-Reply-To: <20190604124101.28116-1-arturx.trybula@intel.com>

This patch fixes Coverity Issue 328524:
Reliance on integer endianness (INCOMPATIBLE_CAST) in function
*parse_window_sz*.

Coverity issue: 328524
Fixes: e0b6287c035d ("app/compress-perf: add parser")

Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
---
 app/test-compress-perf/comp_perf_options_parse.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/app/test-compress-perf/comp_perf_options_parse.c b/app/test-compress-perf/comp_perf_options_parse.c
index 2fb6fb48a..a7a8c1f9e 100644
--- a/app/test-compress-perf/comp_perf_options_parse.c
+++ b/app/test-compress-perf/comp_perf_options_parse.c
@@ -364,12 +364,14 @@ parse_max_num_sgl_segs(struct comp_test_data *test_data, const char *arg)
 static int
 parse_window_sz(struct comp_test_data *test_data, const char *arg)
 {
-	int ret = parse_uint16_t((uint16_t *)&test_data->window_sz, arg);
+	uint16_t tmp;
+	int ret = parse_uint16_t(&tmp, arg);
 
 	if (ret) {
 		RTE_LOG(ERR, USER1, "Failed to parse window size\n");
 		return -1;
 	}
+	test_data->window_sz = (int)tmp;
 
 	return 0;
 }
-- 
2.17.1


  reply	other threads:[~2019-06-04 12:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-03 13:50 [dpdk-dev] [PATCH] app/test-compress-perf: fix reliance on integer endianness (CI:328524) Artur Trybula
2019-06-04  9:05 ` Mcnamara, John
2019-06-04 12:41 ` [dpdk-dev] [PATCH v2 0/1] app/test-compress-perf: fix reliance on integer endianness Artur Trybula
2019-06-04 12:41   ` Artur Trybula [this message]
2019-06-26 17:06     ` [dpdk-dev] [PATCH v2 1/1] " Shally Verma
2019-07-01 11:37       ` Akhil Goyal

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=20190604124101.28116-2-arturx.trybula@intel.com \
    --to=arturx.trybula@intel.com \
    --cc=adamx.dybkowski@intel.com \
    --cc=dev@dpdk.org \
    --cc=fiona.trahe@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).