app/procinfo: remove useless assignment
authorFerruh Yigit <ferruh.yigit@intel.com>
Thu, 19 Nov 2020 11:58:54 +0000 (11:58 +0000)
committerDavid Marchand <david.marchand@redhat.com>
Mon, 11 Jan 2021 09:45:34 +0000 (10:45 +0100)
'flag' is initialized to '0' but it is overwritten later, moving the
declaration where it is used and initialize with actual value.

Fixes: 0101a0ec6217 ("app/procinfo: add --show-mempool")
Cc: stable@dpdk.org
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
app/proc-info/main.c

index 106b44d..44249dd 100644 (file)
@@ -1264,8 +1264,6 @@ show_ring(char *name)
 static void
 show_mempool(char *name)
 {
-       uint64_t flags = 0;
-
        snprintf(bdr_str, MAX_STRING_LEN, " show - MEMPOOL ");
        STATS_BDR_STR(10, bdr_str);
 
@@ -1273,8 +1271,8 @@ show_mempool(char *name)
                struct rte_mempool *ptr = rte_mempool_lookup(name);
                if (ptr != NULL) {
                        struct rte_mempool_ops *ops;
+                       uint64_t flags = ptr->flags;
 
-                       flags = ptr->flags;
                        ops = rte_mempool_get_ops(ptr->ops_index);
                        printf("  - Name: %s on socket %d\n"
                                "  - flags:\n"