[dpdk-dev] app/testpmd: fix print unused parameter name

Message ID 20180514032048.34896-1-zhiyong.yang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Yang, Zhiyong May 14, 2018, 3:20 a.m. UTC
  The second parameter "name" in the function rte_eth_dev_detach
has been already redefined as "char *name __rte_unused",
"port_id" is printed instead of "name" in testpmd.

Fixes: b65ecf199324 ("devargs: rename legacy API")
Cc: stable@dpdk.org
Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 app/test-pmd/testpmd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Matan Azrad May 14, 2018, 10:38 a.m. UTC | #1
Hi 

From: zhiyong.yang@intel.com
> The second parameter "name" in the function rte_eth_dev_detach has been
> already redefined as "char *name __rte_unused", "port_id" is printed instead
> of "name" in testpmd.
> 
> Fixes: b65ecf199324 ("devargs: rename legacy API")
> Cc: stable@dpdk.org

Really minor : Missing empty line here.

> Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Acked-by: Matan Azrad <matan@mellanox.com>
> ---
>  app/test-pmd/testpmd.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> 664c43554..02a28199b 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -1985,7 +1985,7 @@ detach_port(portid_t port_id)
>  		port_flow_flush(port_id);
> 
>  	if (rte_eth_dev_detach(port_id, name)) {
> -		TESTPMD_LOG(ERR, "Failed to detach port '%s'\n", name);
> +		TESTPMD_LOG(ERR, "Failed to detach port %u\n", port_id);
>  		return;
>  	}
> 
> @@ -1993,8 +1993,8 @@ detach_port(portid_t port_id)
> 
>  	update_fwd_ports(RTE_MAX_ETHPORTS);
> 
> -	printf("Port '%s' is detached. Now total ports is %d\n",
> -			name, nb_ports);
> +	printf("Port %u is detached. Now total ports is %d\n",
> +			port_id, nb_ports);
>  	printf("Done\n");
>  	return;
>  }
> --
> 2.14.3
  
Thomas Monjalon May 14, 2018, 10:51 a.m. UTC | #2
14/05/2018 12:38, Matan Azrad:
> 
> Hi 
> 
> From: zhiyong.yang@intel.com
> > The second parameter "name" in the function rte_eth_dev_detach has been
> > already redefined as "char *name __rte_unused", "port_id" is printed instead
> > of "name" in testpmd.
> > 
> > Fixes: b65ecf199324 ("devargs: rename legacy API")
> > Cc: stable@dpdk.org
> 
> Really minor : Missing empty line here.
> 
> > Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
> Acked-by: Matan Azrad <matan@mellanox.com>

Title: app/testpmd: fix log after detach

Applied, thanks
  

Patch

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 664c43554..02a28199b 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1985,7 +1985,7 @@  detach_port(portid_t port_id)
 		port_flow_flush(port_id);
 
 	if (rte_eth_dev_detach(port_id, name)) {
-		TESTPMD_LOG(ERR, "Failed to detach port '%s'\n", name);
+		TESTPMD_LOG(ERR, "Failed to detach port %u\n", port_id);
 		return;
 	}
 
@@ -1993,8 +1993,8 @@  detach_port(portid_t port_id)
 
 	update_fwd_ports(RTE_MAX_ETHPORTS);
 
-	printf("Port '%s' is detached. Now total ports is %d\n",
-			name, nb_ports);
+	printf("Port %u is detached. Now total ports is %d\n",
+			port_id, nb_ports);
 	printf("Done\n");
 	return;
 }