Skip to contentSkip to conversation

octeon_ep: remove redundant memset in octep_setup_pfvf_mbox()

PATCH Applied Sang-Heon Jeon 3 participants 3 messages Sep 1 – Sep 3

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 octeon_ep: remove redundant memset in octep_setup_pfvf_mbox()

vzalloc() returns zeroed memory, so the memset after the allocation is redundant.

No functional change.

---
 drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c +0 -1
index 0867fab61b19..e4175d5bdb3b 100644
@@ -274,7 +274,6 @@ int octep_setup_pfvf_mbox(struct octep_device *oct)
 		if (!oct->mbox[ring])
 			goto free_mbox;
 
-		memset(oct->mbox[ring], 0, sizeof(struct octep_mbox));
 		memset(&oct->vf_info[i], 0, sizeof(struct octep_pfvf_info));
 		mutex_init(&oct->mbox[ring]->lock);
 		INIT_WORK(&oct->mbox[ring]->wk.work, octep_pfvf_mbox_work);
Signature · 1 line
2.43.0
Reviewed-by Xuanqiang Luo on v1 1/1
#1 lore raw
Quoted 6 lines · Sang-Heon Jeon

vzalloc() returns zeroed memory, so the memset after the allocation is redundant.

No functional change.

Xuanqiang

Quoted 16 lines
---
  drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c | 1 -
  1 file changed, 1 deletion(-)
drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c +0 -1
index 0867fab61b19..e4175d5bdb3b 100644
@@ -274,7 +274,6 @@ int octep_setup_pfvf_mbox(struct octep_device *oct)
  		if (!oct->mbox[ring])
  			goto free_mbox;
 
-		memset(oct->mbox[ring], 0, sizeof(struct octep_mbox));
  		memset(&oct->vf_info[i], 0, sizeof(struct octep_pfvf_info));
  		mutex_init(&oct->mbox[ring]->lock);
  		INIT_WORK(&oct->mbox[ring]->wk.work, octep_pfvf_mbox_work);
#2 lore raw
In reply to Sang-Heon Jeon
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 8 lines · On Tue, 1 Sep 2026 20:09:11 +0900 you wrote:

vzalloc() returns zeroed memory, so the memset after the allocation is redundant.

No functional change.

[...]

Here is the summary with links:
- [net-next] octeon_ep: remove redundant memset in octep_setup_pfvf_mbox()

    https://git.kernel.org/netdev/net-next/c/b35d3d2fae30

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html