baseband/acc100: remove logically dead code

Message ID 1603141797-230055-2-git-send-email-nicolas.chautru@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series baseband/acc100: remove logically dead code |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed

Commit Message

Chautru, Nicolas Oct. 19, 2020, 9:09 p.m. UTC
  Coverity reported dead code for a few error
checks which are indeed not reachable.

Coverity issue: 363451, 363454, 363455

Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
---
 drivers/baseband/acc100/rte_acc100_pmd.c | 9 ---------
 1 file changed, 9 deletions(-)
  

Comments

Tom Rix Oct. 21, 2020, 1:58 p.m. UTC | #1
On 10/19/20 2:09 PM, Nicolas Chautru wrote:
> Coverity reported dead code for a few error
> checks which are indeed not reachable.
>
> Coverity issue: 363451, 363454, 363455
>
> Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>

This change looks fine.

Should remove the 'Coverity issue: ... ' from the log.

Reviewed-by: Tom Rix <trix@redhat.com>

> ---
>  drivers/baseband/acc100/rte_acc100_pmd.c | 9 ---------
>  1 file changed, 9 deletions(-)
>
> diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c
> index 47ddbae..5e663a6 100644
> --- a/drivers/baseband/acc100/rte_acc100_pmd.c
> +++ b/drivers/baseband/acc100/rte_acc100_pmd.c
> @@ -2519,9 +2519,6 @@
>  		r++;
>  	}
>  
> -	if (unlikely(desc == NULL))
> -		return current_enqueued_cbs;
> -
>  #ifdef RTE_LIBRTE_BBDEV_DEBUG
>  	if (check_mbuf_total_left(mbuf_total_left) != 0)
>  		return -EINVAL;
> @@ -3076,9 +3073,6 @@
>  		r++;
>  	}
>  
> -	if (unlikely(desc == NULL))
> -		return current_enqueued_cbs;
> -
>  #ifdef RTE_LIBRTE_BBDEV_DEBUG
>  	if (check_mbuf_total_left(mbuf_total_left) != 0)
>  		return -EINVAL;
> @@ -3181,9 +3175,6 @@
>  		r++;
>  	}
>  
> -	if (unlikely(desc == NULL))
> -		return current_enqueued_cbs;
> -
>  #ifdef RTE_LIBRTE_BBDEV_DEBUG
>  	if (check_mbuf_total_left(mbuf_total_left) != 0)
>  		return -EINVAL;
  
John McNamara Oct. 26, 2020, 12:03 p.m. UTC | #2
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Tom Rix
> Sent: Wednesday, October 21, 2020 2:58 PM
> To: Chautru, Nicolas <nicolas.chautru@intel.com>; dev@dpdk.org;
> akhil.goyal@nxp.com
> Cc: Richardson, Bruce <bruce.richardson@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] baseband/acc100: remove logically dead
> code
> 
> 
> On 10/19/20 2:09 PM, Nicolas Chautru wrote:
> > Coverity reported dead code for a few error checks which are indeed
> > not reachable.
> >
> > Coverity issue: 363451, 363454, 363455
> >
> > Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> 
> This change looks fine.
> 
> Should remove the 'Coverity issue: ... ' from the log.
> 
> Reviewed-by: Tom Rix <trix@redhat.com>

It should stay. That is the convention we use:

    git log | grep "Coverity issue"
  
Akhil Goyal Oct. 28, 2020, 11:32 a.m. UTC | #3
> 
> On 10/19/20 2:09 PM, Nicolas Chautru wrote:
> > Coverity reported dead code for a few error
> > checks which are indeed not reachable.
> >
> > Coverity issue: 363451, 363454, 363455
> >
> > Signed-off-by: Nicolas Chautru <nicolas.chautru@intel.com>
> 
> This change looks fine.
> 
> Should remove the 'Coverity issue: ... ' from the log.
> 
> Reviewed-by: Tom Rix <trix@redhat.com>
> 
Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c
index 47ddbae..5e663a6 100644
--- a/drivers/baseband/acc100/rte_acc100_pmd.c
+++ b/drivers/baseband/acc100/rte_acc100_pmd.c
@@ -2519,9 +2519,6 @@ 
 		r++;
 	}
 
-	if (unlikely(desc == NULL))
-		return current_enqueued_cbs;
-
 #ifdef RTE_LIBRTE_BBDEV_DEBUG
 	if (check_mbuf_total_left(mbuf_total_left) != 0)
 		return -EINVAL;
@@ -3076,9 +3073,6 @@ 
 		r++;
 	}
 
-	if (unlikely(desc == NULL))
-		return current_enqueued_cbs;
-
 #ifdef RTE_LIBRTE_BBDEV_DEBUG
 	if (check_mbuf_total_left(mbuf_total_left) != 0)
 		return -EINVAL;
@@ -3181,9 +3175,6 @@ 
 		r++;
 	}
 
-	if (unlikely(desc == NULL))
-		return current_enqueued_cbs;
-
 #ifdef RTE_LIBRTE_BBDEV_DEBUG
 	if (check_mbuf_total_left(mbuf_total_left) != 0)
 		return -EINVAL;