netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] net: dsa: rzn1_a5psw: Make the read-only array offsets static const
@ 2025-04-17 16:11 Colin Ian King
  2025-04-22 16:53 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2025-04-17 16:11 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 and md5_init on the stack
at run time, instead make it static const.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 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] 2+ messages in thread

* Re: [PATCH][next] net: dsa: rzn1_a5psw: Make the read-only array offsets static const
  2025-04-17 16:11 [PATCH][next] net: dsa: rzn1_a5psw: Make the read-only array offsets static const Colin Ian King
@ 2025-04-22 16:53 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2025-04-22 16:53 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

On Thu, Apr 17, 2025 at 05:11:06PM +0100, Colin Ian King wrote:
> Don't populate the read-only array offsets and md5_init on the stack
> at run time, instead make it static const.
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-04-22 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17 16:11 [PATCH][next] net: dsa: rzn1_a5psw: Make the read-only array offsets static const Colin Ian King
2025-04-22 16:53 ` Simon Horman

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).