clk: qcom: Constify struct pll_vco

pll_vco structure are never modified. They are used as .vco_table in
"struct clk_alpha_pll".

And in this structure, we have:
	const struct pll_vco *vco_table;

Constifying these structures moves some data to a read-only section, so
increase overall security.

On a x86_64, with allmodconfig:
Before:
   text	   data	    bss	    dec	    hex	filename
   9905	  47576	      0	  57481	   e089	drivers/clk/qcom/mmcc-msm8994.o

After:
   text	   data	    bss	    dec	    hex	filename
  10033	  47440	      0	  57473	   e081	drivers/clk/qcom/mmcc-msm8994.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/c3c9a75ed77a5ef2e9b72081e88225d84bba91cd.1715359776.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
Christophe JAILLET 2024-05-10 18:50:00 +02:00 committed by Bjorn Andersson
parent d85dc696ca
commit fcd9354ceb
28 changed files with 38 additions and 38 deletions

View File

@ -45,11 +45,11 @@ enum {
P_SLEEP_CLK,
};
static struct pll_vco lucid_vco[] = {
static const struct pll_vco lucid_vco[] = {
{ 249600000, 1800000000, 0 },
};
static struct pll_vco zonda_vco[] = {
static const struct pll_vco zonda_vco[] = {
{ 595200000, 3600000000, 0 },
};

View File

@ -32,7 +32,7 @@ enum {
P_CAMCC_PLL3_OUT_MAIN,
};
static struct pll_vco fabia_vco[] = {
static const struct pll_vco fabia_vco[] = {
{ 249600000, 2000000000, 0 },
};

View File

@ -32,11 +32,11 @@ enum {
P_SLEEP_CLK,
};
static struct pll_vco lucid_vco[] = {
static const struct pll_vco lucid_vco[] = {
{ 249600000, 2000000000, 0 },
};
static struct pll_vco zonda_vco[] = {
static const struct pll_vco zonda_vco[] = {
{ 595200000UL, 3600000000UL, 0 },
};

View File

@ -28,7 +28,7 @@ enum {
P_GPLL0_OUT_MAIN,
};
static struct pll_vco disp_cc_pll_vco[] = {
static const struct pll_vco disp_cc_pll_vco[] = {
{ 500000000, 1000000000, 2 },
};

View File

@ -31,7 +31,7 @@ enum {
P_GCC_DISP_GPLL0_CLK,
};
static struct pll_vco fabia_vco[] = {
static const struct pll_vco fabia_vco[] = {
{ 249600000, 2000000000, 0 },
};

View File

@ -35,7 +35,7 @@ enum {
P_GCC_DISP_GPLL0_CLK,
};
static struct pll_vco lucid_vco[] = {
static const struct pll_vco lucid_vco[] = {
{ 249600000, 2000000000, 0 },
};

View File

@ -71,7 +71,7 @@ enum {
P_SLEEP_CLK,
};
static struct pll_vco lucid_evo_vco[] = {
static const struct pll_vco lucid_evo_vco[] = {
{ 249600000, 2000000000, 0 },
};

View File

@ -71,7 +71,7 @@ enum {
P_SLEEP_CLK,
};
static struct pll_vco lucid_ole_vco[] = {
static const struct pll_vco lucid_ole_vco[] = {
{ 249600000, 2000000000, 0 },
};

View File

@ -69,7 +69,7 @@ enum {
P_SLEEP_CLK,
};
static struct pll_vco lucid_ole_vco[] = {
static const struct pll_vco lucid_ole_vco[] = {
{ 249600000, 2100000000, 0 },
};

View File

@ -27,7 +27,7 @@
#define GCC_MMSS_MISC 0x0902C
#define GCC_GPU_MISC 0x71028
static struct pll_vco fabia_vco[] = {
static const struct pll_vco fabia_vco[] = {
{ 250000000, 2000000000, 0 },
{ 125000000, 1000000000, 1 },
};

View File

@ -39,7 +39,7 @@ enum {
P_SLEEP_CLK,
};
static struct pll_vco trion_vco[] = {
static const struct pll_vco trion_vco[] = {
{ 249600000, 2000000000, 0 },
};

View File

@ -42,15 +42,15 @@ enum {
P_SLEEP_CLK,
};
static struct pll_vco default_vco[] = {
static const struct pll_vco default_vco[] = {
{ 500000000, 1000000000, 2 },
};
static struct pll_vco gpll9_vco[] = {
static const struct pll_vco gpll9_vco[] = {
{ 500000000, 1250000000, 0 },
};
static struct pll_vco gpll10_vco[] = {
static const struct pll_vco gpll10_vco[] = {
{ 750000000, 1500000000, 1 },
};

View File

@ -50,11 +50,11 @@ enum {
P_SLEEP_CLK,
};
static struct pll_vco lucid_vco[] = {
static const struct pll_vco lucid_vco[] = {
{ 249600000, 2000000000, 0 },
};
static struct pll_vco zonda_vco[] = {
static const struct pll_vco zonda_vco[] = {
{ 595200000, 3600000000UL, 0 },
};

View File

@ -48,7 +48,7 @@ static struct clk_branch gpucc_cxo_clk = {
},
};
static struct pll_vco fabia_vco[] = {
static const struct pll_vco fabia_vco[] = {
{ 249600000, 2000000000, 0 },
{ 125000000, 1000000000, 1 },
};

View File

@ -51,7 +51,7 @@ static struct clk_branch gpucc_cxo_clk = {
},
};
static struct pll_vco gpu_vco[] = {
static const struct pll_vco gpu_vco[] = {
{ 1000000000, 2000000000, 0 },
{ 500000000, 1000000000, 2 },
{ 250000000, 500000000, 3 },

View File

@ -38,11 +38,11 @@ enum {
P_GPU_CC_PLL1_OUT_MAIN,
};
static struct pll_vco default_vco[] = {
static const struct pll_vco default_vco[] = {
{ 1000000000, 2000000000, 0 },
};
static struct pll_vco pll1_vco[] = {
static const struct pll_vco pll1_vco[] = {
{ 500000000, 1000000000, 2 },
};

View File

@ -36,7 +36,7 @@ enum {
P_GPU_CC_PLL1_OUT_AUX2,
};
static struct pll_vco gpu_cc_pll_vco[] = {
static const struct pll_vco gpu_cc_pll_vco[] = {
{ 1000000000, 2000000000, 0 },
{ 500000000, 1000000000, 2 },
};

View File

@ -42,7 +42,7 @@ enum {
P_GPU_CC_PLL1_OUT_ODD,
};
static struct pll_vco lucid_vco[] = {
static const struct pll_vco lucid_vco[] = {
{ 249600000, 2000000000, 0 },
};

View File

@ -32,7 +32,7 @@ enum {
P_GPU_CC_PLL1_OUT_MAIN,
};
static struct pll_vco lucid_vco[] = {
static const struct pll_vco lucid_vco[] = {
{ 249600000, 2000000000, 0 },
};

View File

@ -33,7 +33,7 @@ enum {
P_GPU_CC_PLL1_OUT_MAIN,
};
static struct pll_vco lucid_5lpe_vco[] = {
static const struct pll_vco lucid_5lpe_vco[] = {
{ 249600000, 1750000000, 0 },
};

View File

@ -36,7 +36,7 @@ enum {
P_GPU_CC_PLL1_OUT_MAIN,
};
static struct pll_vco lucid_evo_vco[] = {
static const struct pll_vco lucid_evo_vco[] = {
{ 249600000, 2000000000, 0 },
};

View File

@ -37,7 +37,7 @@ enum {
P_GPU_CC_PLL1_OUT_MAIN,
};
static struct pll_vco lucid_ole_vco[] = {
static const struct pll_vco lucid_ole_vco[] = {
{ 249600000, 2100000000, 0 },
};

View File

@ -27,7 +27,7 @@ enum {
P_SLEEP_CLK,
};
static struct pll_vco fabia_vco[] = {
static const struct pll_vco fabia_vco[] = {
{ 249600000, 2000000000, 0 },
};

View File

@ -84,14 +84,14 @@ static const struct clk_parent_data mmcc_xo_dsibyte[] = {
{ .fw_name = "dsi1pllbyte" },
};
static struct pll_vco mmpll_p_vco[] = {
static const struct pll_vco mmpll_p_vco[] = {
{ 250000000, 500000000, 3 },
{ 500000000, 1000000000, 2 },
{ 1000000000, 1500000000, 1 },
{ 1500000000, 2000000000, 0 },
};
static struct pll_vco mmpll_t_vco[] = {
static const struct pll_vco mmpll_t_vco[] = {
{ 500000000, 1500000000, 0 },
};

View File

@ -57,20 +57,20 @@ static struct clk_fixed_factor gpll0_div = {
},
};
static struct pll_vco mmpll_p_vco[] = {
static const struct pll_vco mmpll_p_vco[] = {
{ 250000000, 500000000, 3 },
{ 500000000, 1000000000, 2 },
{ 1000000000, 1500000000, 1 },
{ 1500000000, 2000000000, 0 },
};
static struct pll_vco mmpll_gfx_vco[] = {
static const struct pll_vco mmpll_gfx_vco[] = {
{ 400000000, 1000000000, 2 },
{ 1000000000, 1500000000, 1 },
{ 1500000000, 2000000000, 0 },
};
static struct pll_vco mmpll_t_vco[] = {
static const struct pll_vco mmpll_t_vco[] = {
{ 500000000, 1500000000, 0 },
};

View File

@ -96,14 +96,14 @@ static struct clk_alpha_pll mmpll6 = {
};
/* APSS controlled PLLs */
static struct pll_vco vco[] = {
static const struct pll_vco vco[] = {
{ 1000000000, 2000000000, 0 },
{ 750000000, 1500000000, 1 },
{ 500000000, 1000000000, 2 },
{ 250000000, 500000000, 3 },
};
static struct pll_vco mmpll3_vco[] = {
static const struct pll_vco mmpll3_vco[] = {
{ 750000000, 1500000000, 1 },
};

View File

@ -24,7 +24,7 @@ enum {
P_VIDEO_PLL0_OUT_MAIN,
};
static struct pll_vco trion_vco[] = {
static const struct pll_vco trion_vco[] = {
{ 249600000, 2000000000, 0 },
};

View File

@ -26,7 +26,7 @@ enum {
P_VIDEO_PLL1_OUT_MAIN,
};
static struct pll_vco lucid_vco[] = {
static const struct pll_vco lucid_vco[] = {
{ 249600000, 2000000000, 0 },
};