Skip to contentSkip to conversation

clk: lmk04832: clkout: make read-only const arrays static

PATCH In review Colin Ian King 2 participants 2 messages Jun 27, 2023 – Jul 19, 2023

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

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

Don't populate the arrays on the stack, instead make them static.

---
 drivers/clk/clk-lmk04832.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/clk-lmk04832.c +2 -2
index e22ac93e0c2f..21b425d8a1b7 100644
@@ -369,7 +369,7 @@ static unsigned long lmk04832_vco_recalc_rate(struct clk_hw *hw,
 					      unsigned long prate)
 {
 	struct lmk04832 *lmk = container_of(hw, struct lmk04832, vco);
-	const unsigned int pll2_p[] = {8, 2, 2, 3, 4, 5, 6, 7};
+	static const unsigned int pll2_p[] = {8, 2, 2, 3, 4, 5, 6, 7};
 	unsigned int pll2_n, p, pll2_r;
 	unsigned int pll2_misc;
 	unsigned long vco_rate;
@@ -631,7 +631,7 @@ static int lmk04832_register_vco(struct lmk04832 *lmk)
 
 static int lmk04832_clkout_set_ddly(struct lmk04832 *lmk, int id)
 {
-	const int dclk_div_adj[] = {0, 0, -2, -2, 0, 3, -1, 0};
+	static const int dclk_div_adj[] = {0, 0, -2, -2, 0, 3, -1, 0};
 	unsigned int sclkx_y_ddly = 10;
 	unsigned int dclkx_y_ddly;
 	unsigned int dclkx_y_div;
Signature · 1 line
2.39.2
maintainer
#1 lore raw

Quoting Colin Ian King (2023-06-27 07:01:45)

Quoted 1 line

Don't populate the arrays on the stack, instead make them static.

What improves with this patch?