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.ji...@intel.com
Cc: sta...@dpdk.org

Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richard...@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

Reply via email to