[PATCH v3 10/10] app/test-dma-perf: fix parsing of DMA address
Stephen Hemminger
stephen at networkplumber.org
Fri Nov 15 21:06:54 CET 2024
There was useless loop when looking at the DMA address.
It looks like it was meant to skip whitespace before
calling strtok.
Good time to replace strtok with strtok_r as well.
Link: https://pvs-studio.com/en/blog/posts/cpp/1179/
Fixes: 623dc9364dc6 ("app/dma-perf: introduce DMA performance test")
Cc: cheng1.jiang at intel.com
Cc: stable at dpdk.org
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
app/test-dma-perf/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/test-dma-perf/main.c b/app/test-dma-perf/main.c
index 18219918cc..8d46b1258b 100644
--- a/app/test-dma-perf/main.c
+++ b/app/test-dma-perf/main.c
@@ -229,8 +229,8 @@ parse_lcore_dma(struct test_configure *test_case, const char *value)
return -1;
addrs = input;
- while (*addrs == '\0')
- addrs++;
+ while (isspace(*addrs))
+ ++addrs;
if (*addrs == '\0') {
fprintf(stderr, "No input DMA addresses\n");
ret = -1;
--
2.45.2
More information about the dev
mailing list