Skip to contentSkip to conversation

drm/bridge: tc358767: make read-only array ext_div static const

PATCH Applied Colin Ian King 2 participants 3 messages Nov 12 – Nov 25

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

PATCH 1/1 drm/bridge: tc358767: make read-only array ext_div static const

Don't populate the read-only array ext_div on the stack at run time, instead make it static const

---
 drivers/gpu/drm/bridge/tc358767.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/tc358767.c +1 -1
index f61c619fb305..3735e8db9e82 100644
@@ -593,12 +593,12 @@ static int tc_pllupdate(struct tc_data *tc, unsigned int pllctrl)
 static int tc_pxl_pll_calc(struct tc_data *tc, u32 refclk, u32 pixelclock,
 			   int *out_best_pixelclock, u32 *out_pxl_pllparam)
 {
+	static const int ext_div[] = { 1, 2, 3, 5, 7 };
 	int i_pre, best_pre = 1;
 	int i_post, best_post = 1;
 	int div, best_div = 1;
 	int mul, best_mul = 1;
 	int delta, best_delta;
-	int ext_div[] = {1, 2, 3, 5, 7};
 	int clk_min, clk_max;
 	int best_pixelclock = 0;
 	int vco_hi = 0;
Signature · 1 line
2.55.0
reviewer Applied
#2 lore raw
In reply to Colin Ian King
Quoted 2 lines · Colin Ian King

Don't populate the read-only array ext_div on the stack at run time, instead make it static const

Applied, thanks!

[1/1] drm/bridge: tc358767: make read-only array ext_div static const

      commit: 632586bd82b0158a97c6eb6830375c1efda6e0f6

Best regards,

Signature · 3 lines
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com