[03/15] net/ena/base: remove redundant assert checks

Message ID 20240702144626.14545-4-shaibran@amazon.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/ena: driver release 2.10.0 |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Brandes, Shai July 2, 2024, 2:46 p.m. UTC
From: Shai Brandes <shaibran@amazon.com>

Remove ENA_WARN checks from ena_com_wait_and_process_admin_cq_polling
since once the execution flow reaches the check, it must be
ENA_CMD_COMPLETED because it can't be either of the other options:
1. ENA_CMD_ABORTED - in such case it will perform "goto err" in the "if"
   block above, thus skipping the ENA_WARN check.
2. ENA_CMD_SUBMITTED - in such case it will timeout inside the while(1)
   loop above and perform "goto err", thus skipping the ENA_WARN check.

Remove ENA_WARN check from ena_com_wait_and_process_admin_cq_interrupts
since once the execution flow reaches the check, it must be
ENA_CMD_COMPLETED because it can't be either of the other options:
1. ENA_CMD_ABORTED - same as above, i will perform "goto err" in the
   "if" block above, thus skipping the ENA_WARN check.
2. ENA_CMD_SUBMITTED - in such case it will perform "goto err" in the
   nested if block above, since "admin_queue->polling" is false (because
   of the interrupt mode execution of admin commands)

Signed-off-by: Shai Brandes <shaibran@amazon.com>
---
 drivers/net/ena/base/ena_com.c | 8 --------
 1 file changed, 8 deletions(-)
  

Patch

diff --git a/drivers/net/ena/base/ena_com.c b/drivers/net/ena/base/ena_com.c
index 9e1fa40c0c..f9dd086484 100644
--- a/drivers/net/ena/base/ena_com.c
+++ b/drivers/net/ena/base/ena_com.c
@@ -598,10 +598,6 @@  static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_c
 		goto err;
 	}
 
-	ENA_WARN(comp_ctx->status != ENA_CMD_COMPLETED,
-		 admin_queue->ena_dev, "Invalid comp status %d\n",
-		 comp_ctx->status);
-
 	ret = ena_com_comp_status_to_errno(admin_queue, comp_ctx->comp_status);
 err:
 	comp_ctxt_release(admin_queue, comp_ctx);
@@ -828,10 +824,6 @@  static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *com
 		goto err;
 	}
 
-	ENA_WARN(comp_ctx->status != ENA_CMD_COMPLETED,
-		 admin_queue->ena_dev, "Invalid comp status %d\n",
-		 comp_ctx->status);
-
 	ret = ena_com_comp_status_to_errno(admin_queue, comp_ctx->comp_status);
 err:
 	comp_ctxt_release(admin_queue, comp_ctx);