[dpdk-dev] [PATCH 4/4] app/procinfo: remove useless assignment

Varghese, Vipin vipin.varghese at intel.com
Tue Nov 17 19:04:42 CET 2020


Hi Ferruh,

Thanks for the update

snipped
> show_mempool(char *name)  {
> -	uint64_t flags = 0;
> +	uint64_t flags;
> 

Checking the current code base it makes more sense to move the code inside `if` condition check. Sample code shared below

```
-	uint64_t flags = 0;

	snprintf(bdr_str, MAX_STRING_LEN, " show - MEMPOOL ");
	STATS_BDR_STR(10, bdr_str);

	if (name != NULL) {
		struct rte_mempool *ptr = rte_mempool_lookup(name);
		if (ptr != NULL) {
			struct rte_mempool_ops *ops;

+			unsigned int flags = ptr->flags;
			ops = rte_mempool_get_ops(ptr->ops_index);
```

But it is ok


More information about the dev mailing list