Skip to contentSkip to conversation

net/dpaa2: remove unnecessary loop for unused pool entries

PATCH Applied Gavin Hu 3 participants 3 messages Jul 31, 2018 – Aug 3, 2018 Network drivers

lore
Share & tools
lore

Gavin Hu

author
#0 lore raw

PATCH 1/1 net/dpaa2: remove unnecessary loop for unused pool entries

Currently only one buffer pool is configured and in use, looping for up to maxmum 8 times is unnecessary and might be buggy as assigned uninititalized values.

The fix is to loop for the configured times with initialize with valid values.

Fixes 16bbc98a3e ("bus/fslmc: update MC to 10.3.x")
---
 drivers/net/dpaa2/mc/dpni.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dpaa2/mc/dpni.c +1 -1
index 69cf119ce..9f228169a 100644
@@ -198,7 +198,7 @@ int dpni_set_pools(struct fsl_mc_io *mc_io,
 					  token);
 	cmd_params = (struct dpni_cmd_set_pools *)cmd.params;
 	cmd_params->num_dpbp = cfg->num_dpbp;
-	for (i = 0; i < DPNI_MAX_DPBP; i++) {
+	for (i = 0; i < cmd_params->num_dpbp; i++) {
 		cmd_params->pool[i].dpbp_id =
 			cpu_to_le16(cfg->pools[i].dpbp_id);
 		cmd_params->pool[i].priority_mask =
Signature · 1 line
2.11.0
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Gavin Hu

Currently only one buffer pool is configured and in use, looping for up to maxmum 8 times is unnecessary and might be buggy as assigned uninititalized values.

The fix is to loop for the configured times with initialize with valid values.

Quoted 6 lines
Fixes 16bbc98a3e ("bus/fslmc: update MC to 10.3.x")

---

#2 lore raw

31/07/2018 15:52, Shreyansh Jain:

Quoted 8 lines · Gavin Hu
Quoted 7 lines

Currently only one buffer pool is configured and in use, looping for up to maxmum 8 times is unnecessary and might be buggy as assigned uninititalized values.

The fix is to loop for the configured times with initialize with valid values.

Quoted 8 lines
Quoted 6 lines
Fixes 16bbc98a3e ("bus/fslmc: update MC to 10.3.x")

---

Applied, thanks