Thread (3 messages) 3 messages, 3 authors, 2026-01-04

Re: [PATCH][next] scsi: ufs: host: mediatek: make read-only array scale_us static const

From: Peter Wang (王信友) <peter.wang@mediatek.com>
Date: 2025-12-22 08:13:09
Also in: kernel-janitors, linux-mediatek, linux-scsi, lkml

On Fri, 2025-12-19 at 21:44 +0000, Colin Ian King wrote:
quoted hunk ↗ jump to hunk
Don't populate the read-only array scale_us on the stack at run time,
instead make it static const.

Signed-off-by: Colin Ian King <redacted>
---
 drivers/ufs/host/ufs-mediatek.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-
mediatek.c
index ecbbf52bf734..66b11cc0703b 100644
--- a/drivers/ufs/host/ufs-mediatek.c
+++ b/drivers/ufs/host/ufs-mediatek.c
@@ -1112,7 +1112,7 @@ static void ufs_mtk_setup_clk_gating(struct
ufs_hba *hba)
        unsigned long flags;
        u32 ah_ms = 10;
        u32 ah_scale, ah_timer;
-       u32 scale_us[] = {1, 10, 100, 1000, 10000, 100000};
+       static const u32 scale_us[] = {1, 10, 100, 1000, 10000,
100000};
Reviewed-by: Peter Wang <peter.wang@mediatek.com>

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help