diff mbox series

[v2] raw/dpaa2_qdma: fix missing parentheses

Message ID 1599613906-19420-1-git-send-email-wangyunjian@huawei.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series [v2] raw/dpaa2_qdma: fix missing parentheses | expand

Checks

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

Commit Message

wangyunjian Sept. 9, 2020, 1:11 a.m. UTC
From: Yunjian Wang <wangyunjian@huawei.com>

This issue detected by coverity, CID#279443(Structurally dead code).

Coverity issue: 279443
Fixes: c22fab9a6c34 ("raw/dpaa2_qdma: support configuration APIs")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
v2: fix spelling in commit log
---
 drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Thomas Monjalon Oct. 6, 2020, 9:33 p.m. UTC | #1
Nipun, could you review please?

09/09/2020 03:11, wangyunjian:
> From: Yunjian Wang <wangyunjian@huawei.com>
> 
> This issue detected by coverity, CID#279443(Structurally dead code).
> 
> Coverity issue: 279443
> Fixes: c22fab9a6c34 ("raw/dpaa2_qdma: support configuration APIs")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
> v2: fix spelling in commit log
> ---
>  drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
> index 0b9c4e3d7..4b8474951 100644
> --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
> +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
> @@ -452,9 +452,10 @@ rte_qdma_reset(void)
>  	/* In case there are pending jobs on any VQ, return -EBUSY */
>  	for (i = 0; i < qdma_dev.max_vqs; i++) {
>  		if (qdma_vqs[i].in_use && (qdma_vqs[i].num_enqueues !=
> -		    qdma_vqs[i].num_dequeues))
> +		    qdma_vqs[i].num_dequeues)) {
>  			DPAA2_QDMA_ERR("Jobs are still pending on VQ: %d", i);
>  			return -EBUSY;
> +		}
>  	}
>  
>  	/* Reset HW queues */
>
Nipun Gupta Oct. 7, 2020, 5:35 a.m. UTC | #2
Acked by: Nipun Gupta <nipun.gupta@nxp.com>

> -----Original Message-----
> From: wangyunjian <wangyunjian@huawei.com>
> Sent: Wednesday, September 9, 2020 6:42 AM
> To: dev@dpdk.org
> Cc: Nipun Gupta <nipun.gupta@nxp.com>; jerry.lilijun@huawei.com;
> xudingke@huawei.com; Yunjian Wang <wangyunjian@huawei.com>;
> stable@dpdk.org
> Subject: [dpdk-dev] [PATCH v2] raw/dpaa2_qdma: fix missing parentheses
> 
> From: Yunjian Wang <wangyunjian@huawei.com>
> 
> This issue detected by coverity, CID#279443(Structurally dead code).
> 
> Coverity issue: 279443
> Fixes: c22fab9a6c34 ("raw/dpaa2_qdma: support configuration APIs")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
> v2: fix spelling in commit log
> ---
>  drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
> b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
> index 0b9c4e3d7..4b8474951 100644
> --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
> +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
> @@ -452,9 +452,10 @@ rte_qdma_reset(void)
>  	/* In case there are pending jobs on any VQ, return -EBUSY */
>  	for (i = 0; i < qdma_dev.max_vqs; i++) {
>  		if (qdma_vqs[i].in_use && (qdma_vqs[i].num_enqueues !=
> -		    qdma_vqs[i].num_dequeues))
> +		    qdma_vqs[i].num_dequeues)) {
>  			DPAA2_QDMA_ERR("Jobs are still pending on VQ: %d",
> i);
>  			return -EBUSY;
> +		}
>  	}
> 
>  	/* Reset HW queues */
> --
> 2.18.1
>
Thomas Monjalon Oct. 11, 2020, 8:06 p.m. UTC | #3
> > This issue detected by coverity, CID#279443(Structurally dead code).
> > 
> > Coverity issue: 279443
> > Fixes: c22fab9a6c34 ("raw/dpaa2_qdma: support configuration APIs")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> > ---
> > --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
> > +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
> > @@ -452,9 +452,10 @@ rte_qdma_reset(void)
> >  	/* In case there are pending jobs on any VQ, return -EBUSY */
> >  	for (i = 0; i < qdma_dev.max_vqs; i++) {
> >  		if (qdma_vqs[i].in_use && (qdma_vqs[i].num_enqueues !=
> > -		    qdma_vqs[i].num_dequeues))
> > +		    qdma_vqs[i].num_dequeues)) {
> >  			DPAA2_QDMA_ERR("Jobs are still pending on VQ: %d",
> > i);
> >  			return -EBUSY;
> > +		}
> >  	}

Acked by: Nipun Gupta <nipun.gupta@nxp.com>

I don't understand how it could work before in simplest case.
Changed title to "fix reset".

Applied, thanks
diff mbox series

Patch

diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
index 0b9c4e3d7..4b8474951 100644
--- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
+++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c
@@ -452,9 +452,10 @@  rte_qdma_reset(void)
 	/* In case there are pending jobs on any VQ, return -EBUSY */
 	for (i = 0; i < qdma_dev.max_vqs; i++) {
 		if (qdma_vqs[i].in_use && (qdma_vqs[i].num_enqueues !=
-		    qdma_vqs[i].num_dequeues))
+		    qdma_vqs[i].num_dequeues)) {
 			DPAA2_QDMA_ERR("Jobs are still pending on VQ: %d", i);
 			return -EBUSY;
+		}
 	}
 
 	/* Reset HW queues */