Skip to contentSkip to conversation

drivers/net: fix indication of allocation

PATCH New Andre Muezerie 1 participant 1 message Jan 17, 2025 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/net: fix indication of allocation

When experimenting with the -std=c2x compiler option the error below popped up:

../drivers/net/bnxt/tf_core/tf_sram_mgr.c:952:39: error: incompatible
types when assigning to type ‘_Bool *’ from type ‘_Bool’

The code indicates that the intention was to assign false to the bool being pointed to, not to the pointer itself.

Fixes 37ff91c158a3 ("net/bnxt: add SRAM manager model")
---
 drivers/net/bnxt/tf_core/tf_sram_mgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/bnxt/tf_core/tf_sram_mgr.c +2 -2
index 87e8882fed..0dffd74cd5 100644
@@ -949,7 +949,7 @@ int tf_sram_mgr_is_allocated(void *sram_handle,
 			    tf_sram_slice_2_str(parms->slice_size),
 			    tf_sram_bank_2_str(parms->bank_id));
 
-		parms->is_allocated = false;
+		*parms->is_allocated = false;
 		goto done;
 	}
 
@@ -964,7 +964,7 @@ int tf_sram_mgr_is_allocated(void *sram_handle,
 	if (block == NULL) {
 		TFP_DRV_LOG(ERR, "block not found in list 0x%x\n",
 			    parms->sram_offset);
-		parms->is_allocated = false;
+		*parms->is_allocated = false;
 		goto done;
 	}
 
Signature · 1 line
2.47.2.vfs.0.1