* [PATCH][next] net: dsa: microchip: make read-only array ts_reg static const
@ 2025-12-19 21:33 Colin Ian King
2025-12-22 11:50 ` Paolo Abeni
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2025-12-19 21:33 UTC (permalink / raw)
To: Woojung Huh, UNGLinuxDriver, Andrew Lunn, Vladimir Oltean,
David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Richard Cochran, netdev
Cc: kernel-janitors, linux-kernel
Don't populate the read-only array ts_reg 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/microchip/ksz_ptp.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dsa/microchip/ksz_ptp.c b/drivers/net/dsa/microchip/ksz_ptp.c
index 997e4a76d0a6..839b0202076d 100644
--- a/drivers/net/dsa/microchip/ksz_ptp.c
+++ b/drivers/net/dsa/microchip/ksz_ptp.c
@@ -1088,8 +1088,11 @@ 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;
--
2.51.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH][next] net: dsa: microchip: make read-only array ts_reg static const
2025-12-19 21:33 [PATCH][next] net: dsa: microchip: make read-only array ts_reg static const Colin Ian King
@ 2025-12-22 11:50 ` Paolo Abeni
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Abeni @ 2025-12-22 11:50 UTC (permalink / raw)
To: Colin Ian King, Woojung Huh, UNGLinuxDriver, Andrew Lunn,
Vladimir Oltean, David S . Miller, Eric Dumazet, Jakub Kicinski,
Richard Cochran, netdev
Cc: kernel-janitors, linux-kernel
On 12/19/25 10:33 PM, Colin Ian King wrote:
> Don't populate the read-only array ts_reg on the stack at run time,
> instead make it static const.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
## Form letter - net-next-closed
The net-next tree is closed for new drivers, features, code refactoring
and optimizations due to the merge window and the winter break. We are
currently accepting bug fixes only.
Please repost when net-next reopens after Jan 2nd.
RFC patches sent for review only are obviously welcome at any time.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-12-22 11:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-19 21:33 [PATCH][next] net: dsa: microchip: make read-only array ts_reg static const Colin Ian King
2025-12-22 11:50 ` Paolo Abeni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®