net/bnxt: remove code to initialize SRAM slice node
Checks
Commit Message
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
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
@@ -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;
}