projects/linux·commit 309a29b5

scsi: ufs: host: mediatek: Make read-only array scale_us static const

309a29b5 · Colin Ian King <[email protected]> · 2025-12-19 21:44:28 +00:00

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 <[email protected]>
Reviewed-by: Peter Wang <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Martin K. Petersen <[email protected]>
Commit
309a29b5965a0b2f36b3e245213eb43300a89ac2
Parents
d0f6cfb4

Changes

1 files changed · +1 −1

FileStatusAddDelContent
drivers/ufs/host/ufs-mediatek.cmodified+1−1View file

drivers/ufs/host/ufs-mediatek.c

View file
diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
index ecbbf52..66b11cc 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};
if (ufshcd_is_clkgating_allowed(hba)) {
if (ufshcd_is_auto_hibern8_supported(hba) && hba->ahit) {