Skip to contentSkip to conversation

clk: ep93xx: make const read-only arrays static

PATCH Applied Colin Ian King 2 participants 2 messages Jan 12, 2025 – Jan 13, 2025

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

PATCH 1/1 clk: ep93xx: make const read-only arrays static

Don't populate the const read-only arrays on the stack at run time, instead make them static.

---
 drivers/clk/clk-ep93xx.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/clk-ep93xx.c +3 -3
index f888aed79b11..4bd8d6ecf6a2 100644
@@ -586,9 +586,9 @@ static unsigned long calc_pll_rate(u64 rate, u32 config_word)
 
 static int ep93xx_plls_init(struct ep93xx_clk_priv *priv)
 {
-	const char fclk_divisors[] = { 1, 2, 4, 8, 16, 1, 1, 1 };
-	const char hclk_divisors[] = { 1, 2, 4, 5, 6, 8, 16, 32 };
-	const char pclk_divisors[] = { 1, 2, 4, 8 };
+	static const char fclk_divisors[] = { 1, 2, 4, 8, 16, 1, 1, 1 };
+	static const char hclk_divisors[] = { 1, 2, 4, 5, 6, 8, 16, 32 };
+	static const char pclk_divisors[] = { 1, 2, 4, 8 };
 	struct clk_parent_data xtali = { .index = 0 };
 	unsigned int clk_f_div, clk_h_div, clk_p_div;
 	unsigned long clk_pll1_rate, clk_pll2_rate;
Signature · 1 line
2.47.1
maintainer Applied
#1 lore raw

Quoting Colin Ian King (2025-01-12 13:39:47)

Quoted 5 lines

Don't populate the const read-only arrays on the stack at run time, instead make them static.

---

Applied to clk-next