net: dsa: rzn1_a5psw: Make the read-only array offsets static const
Subsystems (5)
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
@@ -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
Quoted 4 lines · Colin Ian King
Don't populate the read-only array offsets on the stack at run time, instead make it static const.
Signed-off-by Colin Ian King <[email protected]>
Andrew
Quoted 4 lines · Colin Ian King
Don't populate the read-only array offsets on the stack at run time, instead make it static const.
Signed-off-by Colin Ian King <[email protected]>
Works on my RZ/N1D-DB + EB.
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.
Signed-off-by Colin Ian King <[email protected]>---
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