* [PATCH][next][V2] net: dsa: rzn1_a5psw: Make the read-only array offsets static const
@ 2025-04-17 16:13 Colin Ian King
2025-04-17 17:28 ` Andrew Lunn
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Colin Ian King @ 2025-04-17 16:13 UTC (permalink / raw)
To: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
linux-renesas-soc, netdev
Cc: kernel-janitors, linux-kernel
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 <colin.i.king@gmail.com>
---
V2: Fix commit message
---
drivers/net/dsa/rzn1_a5psw.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
index 31ea8130a495..df7466d4fe8f 100644
--- a/drivers/net/dsa/rzn1_a5psw.c
+++ b/drivers/net/dsa/rzn1_a5psw.c
@@ -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++)
--
2.49.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH][next][V2] net: dsa: rzn1_a5psw: Make the read-only array offsets static const
2025-04-17 16:13 [PATCH][next][V2] net: dsa: rzn1_a5psw: Make the read-only array offsets static const Colin Ian King
@ 2025-04-17 17:28 ` Andrew Lunn
2025-04-18 18:50 ` Wolfram Sang
2025-04-23 2:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2025-04-17 17:28 UTC (permalink / raw)
To: Colin Ian King
Cc: Clément Léger, Vladimir Oltean, David S . Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, linux-renesas-soc,
netdev, kernel-janitors, linux-kernel
On Thu, Apr 17, 2025 at 05:13:52PM +0100, Colin Ian King 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 <colin.i.king@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][next][V2] net: dsa: rzn1_a5psw: Make the read-only array offsets static const
2025-04-17 16:13 [PATCH][next][V2] net: dsa: rzn1_a5psw: Make the read-only array offsets static const Colin Ian King
2025-04-17 17:28 ` Andrew Lunn
@ 2025-04-18 18:50 ` Wolfram Sang
2025-04-23 2:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2025-04-18 18:50 UTC (permalink / raw)
To: Colin Ian King
Cc: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
linux-renesas-soc, netdev, kernel-janitors, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 389 bytes --]
On Thu, Apr 17, 2025 at 05:13:52PM +0100, Colin Ian King 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 <colin.i.king@gmail.com>
Works on my RZ/N1D-DB + EB.
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH][next][V2] net: dsa: rzn1_a5psw: Make the read-only array offsets static const
2025-04-17 16:13 [PATCH][next][V2] net: dsa: rzn1_a5psw: Make the read-only array offsets static const Colin Ian King
2025-04-17 17:28 ` Andrew Lunn
2025-04-18 18:50 ` Wolfram Sang
@ 2025-04-23 2:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-04-23 2:10 UTC (permalink / raw)
To: Colin Ian King
Cc: clement.leger, andrew, olteanv, davem, edumazet, kuba, pabeni,
linux-renesas-soc, netdev, kernel-janitors, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
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 <colin.i.king@gmail.com>
> ---
>
> 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!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-04-23 2:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17 16:13 [PATCH][next][V2] net: dsa: rzn1_a5psw: Make the read-only array offsets static const Colin Ian King
2025-04-17 17:28 ` Andrew Lunn
2025-04-18 18:50 ` Wolfram Sang
2025-04-23 2:10 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).