From: Colin Ian King Date: Thu, 17 Apr 2025 16:13:52 +0000 (+0100) Subject: net: dsa: rzn1_a5psw: Make the read-only array offsets static const X-Git-Tag: v6.16-rc1~132^2~243 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=f7ca612018cfd4e2a33b0600d89c917fdec6e11c;p=linux-block.git 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. Signed-off-by: Colin Ian King Reviewed-by: Andrew Lunn Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Link: https://patch.msgid.link/20250417161353.490219-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski --- 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++)