examples/ethtool: remove redundant assignment

Message ID 1618972783-22453-1-git-send-email-humin29@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series examples/ethtool: remove redundant assignment |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

humin (Q) April 21, 2021, 2:39 a.m. UTC
  From: Chengwen Feng <fengchengwen@huawei.com>

The new_mtu was assigned twice, the first assignment could be removed.

Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
---
 examples/ethtool/ethtool-app/ethapp.c | 1 -
 1 file changed, 1 deletion(-)
  

Comments

Thomas Monjalon April 21, 2021, 6:27 p.m. UTC | #1
21/04/2021 04:39, Min Hu (Connor):
> From: Chengwen Feng <fengchengwen@huawei.com>
> 
> The new_mtu was assigned twice, the first assignment could be removed.
> 
> Fixes: bda68ab9d1e7 ("examples/ethtool: add user-space ethtool sample application")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
> ---
> -	new_mtu = atoi(params->opt);
>  	new_mtu = strtoul(params->opt, &ptr_parse_end, 10);

Indeed, it looks useless.

Applied, thanks.
  

Patch

diff --git a/examples/ethtool/ethtool-app/ethapp.c b/examples/ethtool/ethtool-app/ethapp.c
index e6c93e1..36a1c37 100644
--- a/examples/ethtool/ethtool-app/ethapp.c
+++ b/examples/ethtool/ethtool-app/ethapp.c
@@ -528,7 +528,6 @@  pcmd_mtu_callback(void *ptr_params,
 		printf("Error: Invalid port number %i\n", params->port);
 		return;
 	}
-	new_mtu = atoi(params->opt);
 	new_mtu = strtoul(params->opt, &ptr_parse_end, 10);
 	if (*ptr_parse_end != '\0' ||
 			new_mtu < RTE_ETHER_MIN_MTU ||