diff mbox series

net/bnxt: remove code to initialize SRAM slice node

Message ID 20210925142401.53868-1-ajit.khaparde@broadcom.com (mailing list archive)
State Accepted
Delegated to: Ajit Khaparde
Headers show
Series net/bnxt: remove code to initialize SRAM slice node | expand

Checks

Context Check Description
ci/iol-testing warning apply patch failure
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Ajit Khaparde Sept. 25, 2021, 2:24 p.m. UTC
From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>

Remove the code to initialize SRAM slice mode explicitly. The
code is redundanat as the memory allocated is initialized to
zero by the rte_zmalloc. This fixes the compilation issue for
uninitialized pointer when debug optimized configuration is used.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Farah Smith <farah.smith@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/tf_core/tf_sram_mgr.c | 47 --------------------------
 1 file changed, 47 deletions(-)

Comments

Ferruh Yigit Sept. 27, 2021, 10:25 a.m. UTC | #1
On 9/25/2021 3:24 PM, Ajit Khaparde wrote:
> From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
> 
> Remove the code to initialize SRAM slice mode explicitly. The
> code is redundanat as the memory allocated is initialized to
> zero by the rte_zmalloc. This fixes the compilation issue for
> uninitialized pointer when debug optimized configuration is used.
> 
> Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
> Reviewed-by: Farah Smith <farah.smith@broadcom.com>
> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

Squashed into relevant commit [1] in next-net, thanks.

[1]
net/bnxt: add SRAM manager model
diff mbox series

Patch

diff --git a/drivers/net/bnxt/tf_core/tf_sram_mgr.c b/drivers/net/bnxt/tf_core/tf_sram_mgr.c
index f633a78b25..a248ef2ce8 100644
--- a/drivers/net/bnxt/tf_core/tf_sram_mgr.c
+++ b/drivers/net/bnxt/tf_core/tf_sram_mgr.c
@@ -407,19 +407,6 @@  tf_sram_is_slice_allocated_in_block(struct tf_sram_block *block,
 	return rc;
 }
 
-/**
- * Initialize slice list
- */
-static void
-tf_sram_init_slice_list(struct tf_sram_slice_list *slice_list,
-			enum tf_sram_slice_size slice_size)
-{
-	slice_list->head = NULL;
-	slice_list->tail = NULL;
-	slice_list->cnt = 0;
-	slice_list->size = slice_size;
-}
-
 /**
  * Get the block count
  */
@@ -568,11 +555,7 @@  int
 tf_sram_mgr_bind(void **sram_handle)
 {
 	int rc = 0;
-	enum tf_sram_bank_id bank_id;
-	enum tf_sram_slice_size slice_size;
 	struct tf_sram *sram;
-	struct tf_sram_slice_list *slice_list;
-	enum tf_dir dir;
 	struct tfp_calloc_parms cparms;
 
 	TF_CHECK_PARMS1(sram_handle);
@@ -589,37 +572,7 @@  tf_sram_mgr_bind(void **sram_handle)
 		return rc;
 	}
 	sram = (struct tf_sram *)cparms.mem_va;
-
-	/* For each direction
-	 */
-	for (dir = 0; dir < TF_DIR_MAX; dir++) {
-		/* For each bank
-		 */
-		for (bank_id = TF_SRAM_BANK_ID_0;
-		     bank_id < TF_SRAM_BANK_ID_MAX;
-		     bank_id++) {
-			/* Create each sized slice empty list
-			 */
-			for (slice_size = TF_SRAM_SLICE_SIZE_8B;
-			     slice_size < TF_SRAM_SLICE_SIZE_MAX;
-			     slice_size++) {
-				rc = tf_sram_get_slice_list(sram, &slice_list,
-							    slice_size, dir,
-							    bank_id);
-				if (rc) {
-					/* Log error */
-					TFP_DRV_LOG(ERR,
-						  "No SRAM slice list, rc:%s\n",
-						  strerror(-rc));
-					return rc;
-				}
-				tf_sram_init_slice_list(slice_list, slice_size);
-			}
-		}
-	}
-
 	*sram_handle = sram;
-
 	return rc;
 }