[v21.02,v3,10/10] net/avp: remove always true condition

Message ID 20201119115900.4095566-11-ferruh.yigit@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series cppcheck |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/travis-robot success Travis build: passed

Commit Message

Ferruh Yigit Nov. 19, 2020, 11:59 a.m. UTC
  There is already a break above for the case "count >= 1", so at this
stage 'count' should be always '0'.

Fixes: 1a85922369c4 ("net/avp: add device configuration")
Cc: stable@dpdk.org

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/avp/avp_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Webster, Steven Nov. 20, 2020, 5:40 p.m. UTC | #1
On 2020-11-19 6:59 a.m., Ferruh Yigit wrote:

> There is already a break above for the case "count >= 1", so at this
> stage 'count' should be always '0'.
> 
> Fixes: 1a85922369c4 ("net/avp: add device configuration")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
>   drivers/net/avp/avp_ethdev.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
> index 5f8187b905..f531e03c02 100644
> --- a/drivers/net/avp/avp_ethdev.c
> +++ b/drivers/net/avp/avp_ethdev.c
> @@ -267,7 +267,7 @@ avp_dev_process_request(struct avp_dev *avp, struct rte_avp_request *request)
>                          break;
>                  }
> 
> -               if ((count < 1) && (retry == 0)) {
> +               if (retry == 0) {
>                          PMD_DRV_LOG(ERR, "Timeout while waiting for a response for %u\n",
>                                      request->req_id);
>                          ret = -ETIME;
> --
> 2.26.2
> 
Acked-by: Steven Webster <steven.webster@windriver.com>
  

Patch

diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index 5f8187b905..f531e03c02 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -267,7 +267,7 @@  avp_dev_process_request(struct avp_dev *avp, struct rte_avp_request *request)
 			break;
 		}
 
-		if ((count < 1) && (retry == 0)) {
+		if (retry == 0) {
 			PMD_DRV_LOG(ERR, "Timeout while waiting for a response for %u\n",
 				    request->req_id);
 			ret = -ETIME;