[v2] net/pfe: no need to check dev to be NULL Pointer

Message ID 20210524093754.21046-1-thierry.herbelot@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Andrew Rybchenko
Headers
Series [v2] net/pfe: no need to check dev to be NULL Pointer |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-testing fail Testing issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Thierry Herbelot May 24, 2021, 9:37 a.m. UTC
  librte_ethdev library is already doing some checks on dev before calling
the link update.

Fixes: acd4818ea2a45 ("net/pfe: add link status update")
Cc: stable@dpdk.org
Cc: Gagandeep Singh <g.singh@nxp.com>

Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
--
V2: rework after noting dev cannot be NULL
---
 drivers/net/pfe/pfe_ethdev.c | 5 -----
 1 file changed, 5 deletions(-)
  

Comments

Gagandeep Singh May 24, 2021, 10:28 a.m. UTC | #1
> -----Original Message-----
> From: Thierry Herbelot <thierry.herbelot@6wind.com>
> Sent: Monday, May 24, 2021 3:08 PM
> To: dev@dpdk.org
> Cc: Thierry Herbelot <thierry.herbelot@6wind.com>; Thomas Monjalon
> <thomas@monjalon.net>; stable@dpdk.org; Gagandeep Singh
> <G.Singh@nxp.com>
> Subject: [PATCH v2] net/pfe: no need to check dev to be NULL Pointer
> 
> librte_ethdev library is already doing some checks on dev before calling
> the link update.
> 
> Fixes: acd4818ea2a45 ("net/pfe: add link status update")
> Cc: stable@dpdk.org
> Cc: Gagandeep Singh <g.singh@nxp.com>
> 
> Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
> --
> V2: rework after noting dev cannot be NULL
> ---

Acked-by: Gagandeep Singh <G.singh@nxp.com>

>  drivers/net/pfe/pfe_ethdev.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c
> index 3135466713fb..feec4d10a26e 100644
> --- a/drivers/net/pfe/pfe_ethdev.c
> +++ b/drivers/net/pfe/pfe_ethdev.c
> @@ -582,11 +582,6 @@ pfe_eth_link_update(struct rte_eth_dev *dev, int
> wait_to_complete __rte_unused)
>  	struct rte_eth_link link, old;
>  	unsigned int lstatus = 1;
> 
> -	if (dev == NULL) {
> -		PFE_PMD_ERR("Invalid device in link_update.\n");
> -		return 0;
> -	}
> -
>  	memset(&old, 0, sizeof(old));
>  	memset(&link, 0, sizeof(struct rte_eth_link));
> 
> --
> 2.29.2
  
Andrew Rybchenko June 29, 2021, 8:27 a.m. UTC | #2
On 5/24/21 1:28 PM, Gagandeep Singh wrote:
> 
> 
>> -----Original Message-----
>> From: Thierry Herbelot <thierry.herbelot@6wind.com>
>> Sent: Monday, May 24, 2021 3:08 PM
>> To: dev@dpdk.org
>> Cc: Thierry Herbelot <thierry.herbelot@6wind.com>; Thomas Monjalon
>> <thomas@monjalon.net>; stable@dpdk.org; Gagandeep Singh
>> <G.Singh@nxp.com>
>> Subject: [PATCH v2] net/pfe: no need to check dev to be NULL Pointer
>>
>> librte_ethdev library is already doing some checks on dev before calling
>> the link update.
>>
>> Fixes: acd4818ea2a45 ("net/pfe: add link status update")
>> Cc: stable@dpdk.org
>> Cc: Gagandeep Singh <g.singh@nxp.com>
>>
>> Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
>> --
>> V2: rework after noting dev cannot be NULL
>> ---
> 
> Acked-by: Gagandeep Singh <G.singh@nxp.com>

Applied, thanks.
  

Patch

diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c
index 3135466713fb..feec4d10a26e 100644
--- a/drivers/net/pfe/pfe_ethdev.c
+++ b/drivers/net/pfe/pfe_ethdev.c
@@ -582,11 +582,6 @@  pfe_eth_link_update(struct rte_eth_dev *dev, int wait_to_complete __rte_unused)
 	struct rte_eth_link link, old;
 	unsigned int lstatus = 1;
 
-	if (dev == NULL) {
-		PFE_PMD_ERR("Invalid device in link_update.\n");
-		return 0;
-	}
-
 	memset(&old, 0, sizeof(old));
 	memset(&link, 0, sizeof(struct rte_eth_link));