Skip to contentSkip to conversation

net: dsa: microchip: make read-only const array ts_reg static

PATCH Applied Colin Ian King 2 participants 2 messages Jul 14 – Jul 22

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

PATCH 1/1 net: dsa: microchip: make read-only const array ts_reg static

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

---
 drivers/net/dsa/microchip/ksz_ptp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/dsa/microchip/ksz_ptp.c +4 -2
index 8b98039320ad..5bdf829a6e38 100644
@@ -1101,8 +1101,10 @@ static void ksz_ptp_msg_irq_free(struct ksz_port *port, u8 n)
 
 static int ksz_ptp_msg_irq_setup(struct ksz_port *port, u8 n)
 {
-	u16 ts_reg[] = {REG_PTP_PORT_PDRESP_TS, REG_PTP_PORT_XDELAY_TS,
-			REG_PTP_PORT_SYNC_TS};
+	static const u16 ts_reg[] = {
+		REG_PTP_PORT_PDRESP_TS, REG_PTP_PORT_XDELAY_TS,
+		REG_PTP_PORT_SYNC_TS
+	};
 	static const char * const name[] = {"pdresp-msg", "xdreq-msg",
 					    "sync-msg"};
 	const struct ksz_dev_ops *ops = port->ksz_dev->dev_ops;
Signature · 1 line
2.53.0
#1 lore raw
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 7 lines · On Tue, 14 Jul 2026 20:14:05 +0100 you wrote:

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

---
 drivers/net/dsa/microchip/ksz_ptp.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Here is the summary with links:
- [next] net: dsa: microchip: make read-only const array ts_reg static

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

You are awesome, thank you!

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