Skip to contentSkip to conversation

net: dsa: rzn1_a5psw: Make the read-only array offsets static const

PATCH Applied Colin Ian King 4 participants 4 messages Apr 17, 2025 – Apr 23, 2025

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

PATCH v2 1/1 net: dsa: rzn1_a5psw: Make the read-only array offsets static const

Don't populate the read-only array offsets on the stack at run time, instead make it static const.

---

V2: Fix commit message

---
 drivers/net/dsa/rzn1_a5psw.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/dsa/rzn1_a5psw.c +3 -2
index 31ea8130a495..df7466d4fe8f 100644
@@ -337,8 +337,9 @@ static void a5psw_port_rx_block_set(struct a5psw *a5psw, int port, bool block)
 static void a5psw_flooding_set_resolution(struct a5psw *a5psw, int port,
 					  bool set)
 {
-	u8 offsets[] = {A5PSW_UCAST_DEF_MASK, A5PSW_BCAST_DEF_MASK,
-			A5PSW_MCAST_DEF_MASK};
+	static const u8 offsets[] = {
+		A5PSW_UCAST_DEF_MASK, A5PSW_BCAST_DEF_MASK, A5PSW_MCAST_DEF_MASK
+	};
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(offsets); i++)
Signature · 1 line
2.49.0
#3 lore raw
In reply to Colin Ian King
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

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

Quoted 9 lines · On Thu, 17 Apr 2025 17:13:52 +0100 you wrote:

Don't populate the read-only array offsets on the stack at run time, instead make it static const.

---

V2: Fix commit message

[...]

Here is the summary with links:
- [next,V2] net: dsa: rzn1_a5psw: Make the read-only array offsets static const

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

You are awesome, thank you!

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