Skip to contentSkip to conversation

app/test-compress-perf: fix reliance on integer endianness (CI:328524)

PATCH Superseded Artur Trybula 4 participants 6 messages Jun 3, 2019 – Jul 1, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/test-compress-perf: fix reliance on integer endianness (CI:328524)

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

---
 app/test-compress-perf/comp_perf_options_parse.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
app/test-compress-perf/comp_perf_options_parse.c +3 -1
index 2fb6fb48a..a7a8c1f9e 100644
@@ -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;
 }
Signature · 1 line
2.17.1
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Artur Trybula
Sent: Monday, June 3, 2019 2:51 PM
To: [email protected]; Trahe, Fiona <[email protected]>; Trybula, ArturX <[email protected]>; Dybkowski, AdamX <[email protected]>
Subject: [dpdk-dev] [PATCH] app/test-compress-perf: fix reliance on integer endianness (CI:328524)

Quoted 3 lines

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

This patch should have a fixes line. The usual message would include:

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

John

#2 lore raw

v2 cover app/test-compress-perf: fix reliance on integer endianness

In reply to Artur Trybula

v2:
* add 'fixes' line to the patch description

Artur Trybula (1):
app/test-compress-perf: fix reliance on integer endianness (CI:328524)

 app/test-compress-perf/comp_perf_options_parse.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.17.1
#3 lore raw

PATCH v2 1/1 app/test-compress-perf: fix reliance on integer endianness

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")
---
 app/test-compress-perf/comp_perf_options_parse.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
app/test-compress-perf/comp_perf_options_parse.c +3 -1
index 2fb6fb48a..a7a8c1f9e 100644
@@ -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;
 }
Signature · 1 line
2.17.1
Acked-by on v2 1/1
#4 lore raw

Re: [dpdk-dev] [PATCH v2 1/1] app/test-compress-perf: fix reliance on integer endianness

Quoted 14 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Artur Trybula
Sent: Tuesday, June 4, 2019 6:11 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Subject: [dpdk-dev] [PATCH v2 1/1] app/test-compress-perf: fix reliance on integer endianness

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

Quoted 5 lines

Coverity issue: 328524

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

---

Shally

Applied
#5 lore raw

Re: [dpdk-dev] [PATCH v2 1/1] app/test-compress-perf: fix reliance on integer endianness

Quoted 7 lines
Quoted 7 lines

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

Quoted 7 lines
Quoted 5 lines

Coverity issue: 328524

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

---

Applied to dpdk-next-crypto

Thanks.