net/iavf: fix unchecked return value

Message ID 20201014082857.81080-1-leyi.rong@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/iavf: fix unchecked return value |

Checks

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

Commit Message

Leyi Rong Oct. 14, 2020, 8:28 a.m. UTC
  Fixes coverity unchecked return value issue.

Coverity issue: 363045
Fixes: 02d212ca3125 ("net/iavf: rename remaining avf strings")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
---
 drivers/net/iavf/iavf_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Qi Zhang Oct. 14, 2020, 11:51 a.m. UTC | #1
> -----Original Message-----
> From: Rong, Leyi <leyi.rong@intel.com>
> Sent: Wednesday, October 14, 2020 4:29 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Rong, Leyi <leyi.rong@intel.com>
> Subject: [PATCH] net/iavf: fix unchecked return value
> 
> Fixes coverity unchecked return value issue.
> 
> Coverity issue: 363045
> Fixes: 02d212ca3125 ("net/iavf: rename remaining avf strings")
> 
> Signed-off-by: Leyi Rong <leyi.rong@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  
Ferruh Yigit Oct. 14, 2020, 12:41 p.m. UTC | #2
On 10/14/2020 9:28 AM, Leyi Rong wrote:
> Fixes coverity unchecked return value issue.
> 
> Coverity issue: 363045
> Fixes: 02d212ca3125 ("net/iavf: rename remaining avf strings")
> 

Hi Leyi,

Can you please put some justification to the commit log, why return value can be 
ignored instead of handling it?

Technically this patch doesn't put you in a better place, still you are not 
checking the return value, indeed it is worse since it is silenced and even 
coverity can't warn you anymore.

> Signed-off-by: Leyi Rong <leyi.rong@intel.com>
> ---
>   drivers/net/iavf/iavf_rxtx.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
> index 7e6e425ac..ca0f5d072 100644
> --- a/drivers/net/iavf/iavf_rxtx.c
> +++ b/drivers/net/iavf/iavf_rxtx.c
> @@ -2077,7 +2077,7 @@ iavf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
>   
>   	/* Check if the descriptor ring needs to be cleaned. */
>   	if (txq->nb_free < txq->free_thresh)
> -		iavf_xmit_cleanup(txq);
> +		(void)iavf_xmit_cleanup(txq);
>   
>   	for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) {
>   		td_cmd = 0;
>
  

Patch

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index 7e6e425ac..ca0f5d072 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -2077,7 +2077,7 @@  iavf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 
 	/* Check if the descriptor ring needs to be cleaned. */
 	if (txq->nb_free < txq->free_thresh)
-		iavf_xmit_cleanup(txq);
+		(void)iavf_xmit_cleanup(txq);
 
 	for (nb_tx = 0; nb_tx < nb_pkts; nb_tx++) {
 		td_cmd = 0;