]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
clk: qcom: Constify struct pll_vco
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 10 May 2024 16:50:00 +0000 (18:50 +0200)
committerBjorn Andersson <andersson@kernel.org>
Mon, 27 May 2024 16:45:04 +0000 (11:45 -0500)
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>
28 files changed:
drivers/clk/qcom/camcc-sc8280xp.c
drivers/clk/qcom/camcc-sm6350.c
drivers/clk/qcom/camcc-sm8250.c
drivers/clk/qcom/dispcc-sm6125.c
drivers/clk/qcom/dispcc-sm6350.c
drivers/clk/qcom/dispcc-sm6375.c
drivers/clk/qcom/dispcc-sm8450.c
drivers/clk/qcom/dispcc-sm8550.c
drivers/clk/qcom/dispcc-sm8650.c
drivers/clk/qcom/gcc-msm8998.c
drivers/clk/qcom/gcc-sc8180x.c
drivers/clk/qcom/gcc-sm6115.c
drivers/clk/qcom/gcc-sm6375.c
drivers/clk/qcom/gpucc-msm8998.c
drivers/clk/qcom/gpucc-sdm660.c
drivers/clk/qcom/gpucc-sm6115.c
drivers/clk/qcom/gpucc-sm6125.c
drivers/clk/qcom/gpucc-sm6375.c
drivers/clk/qcom/gpucc-sm8250.c
drivers/clk/qcom/gpucc-sm8350.c
drivers/clk/qcom/gpucc-sm8450.c
drivers/clk/qcom/gpucc-sm8650.c
drivers/clk/qcom/lpasscorecc-sc7180.c
drivers/clk/qcom/mmcc-msm8994.c
drivers/clk/qcom/mmcc-msm8996.c
drivers/clk/qcom/mmcc-sdm660.c
drivers/clk/qcom/videocc-sm8150.c
drivers/clk/qcom/videocc-sm8250.c

index 8e26ec2def73ad56f75bab241557a92ea38dd908..d8de924a878a9b6757fa6f0f4135924d0804323c 100644 (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 },
 };
 
index e4e7b308ecf161d82470f072cf1ab3c96dfe611d..c6fe684aa780d09b873427c97536818ba34e1f41 100644 (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 },
 };
 
index 9b32c56a5bc5af877510dde4bb79b86bd77cc86b..96103eeda5864714f3c15d0b4ed2a917cd1adc00 100644 (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 },
 };
 
index 1cc5f220a3c4988b9d3444962831ed7d13ac2c3b..85e07731cce2a80870a3a93446365ffca11d7713 100644 (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 },
 };
 
index e4b7464c4d0e9760cd2ee4e7627f5bd62f1e1981..f712cbef94564b09da70fd1c12e354a48dd16ad2 100644 (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 },
 };
 
index d81d4e3c0b0debcfc10b1bb659afc582cfcd4ef3..2d42f85f184b85aebf96212488f37c156d6fc972 100644 (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 },
 };
 
index 49bb4f58c3915085832fa8e178bcbf5e0083060d..5d028871624e9ed8c9f84b5048bc2534592380cb 100644 (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 },
 };
 
index 38ecea805503d3e9b4178e647eac1474984d0984..88f9347ab77c26d8138ae7fe6784be2c4e11687e 100644 (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 },
 };
 
index 3eb64bcad487ed9a2d2b4c5c60ad31c52d5c003f..c0e1ea63166b4aebdf7d882e859d9cfa4e57b3c8 100644 (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 },
 };
 
index cad7f1c7789cfc7ad7bd72e723b23530c5e99b3a..5f8c87c1793f32179a1bf0a40ad0db7a15503945 100644 (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 },
 };
index 5261bfc92b3dc3d6c5c2b09d7b7e6a4b6d500d50..ad905affd3766b98d81e5e96abd4f3c178064147 100644 (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 },
 };
 
index 13e521cd4259698aecb1649de87ac48e8346eb83..167e344ad399626b5d1c256690b86bff22755dd3 100644 (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 },
 };
 
index 84639d5b89bfb7e2a672aac5fb7aff70ac609882..ac1ed2d728f9115d9849b5c846a40e0009da03a2 100644 (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 },
 };
 
index 9a4fdff719ec5b16cfac1cb913d3d6784d6cef05..7b1cb44e31b21bbc987e3c0906af15c42712567f 100644 (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 },
 };
index 459f123a6720b15efd629deabac2a751665362dd..a52d98b7cf4c2c36e5adb683db023fae2ed3350a 100644 (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 },
index fb71c21c9a8969ca7766d5abce5edba816ab80a1..9793dd9a25967a5ae0e00d9d0803ed9ae494ad56 100644 (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 },
 };
 
index 61959ba02f9a492cd8a01bdabfaea55f490a25f9..b719a48fe706c6d46ee4c3020d982726961b0f00 100644 (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 },
 };
index da24276a018e7cf5d339f4aa483f05a2a8c6ab6a..4e9a30a080d392b3e934a47f755fe3e8e38f99a5 100644 (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 },
 };
 
index 84f7f65c8d4289b83aaf8e59074c54d2ffce9d1c..012bd1380f555552f290cfe056f25318b2c28f89 100644 (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 },
 };
 
index 38505d1388b672e4e4450eb8b9361389cf093acf..9437d316d145c054ecf3d41c73881a3b2fd98669 100644 (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 },
 };
 
index 1c4769b646b0eea5b21ad74b807e316f1c00f0fe..7b329a8032892d1570f47f159e41229dfbbfc107 100644 (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 },
 };
 
index 03307e482acaa7b342eaadf6ac27b4373b3667a8..c53306d3093f7562e271dc8bb2d8c98965abbf07 100644 (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 },
 };
 
index fd9cd2e3f95651caa1f4573de0c5115738868344..8ac72d26087e267030769fb53ff3cd8e4d41ef82 100644 (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 },
 };
 
index 3229ff77372f29649b5d4b61cb106659a1e443ae..f19080cf715bcd802f09ecb2a675836a31a03a47 100644 (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 },
 };
 
index d3f2dc798567df98aa8e6b6f3868d6906c8a9dc2..92287d40c3a5f0d15137282c40ddaae917addfcc 100644 (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 },
 };
 
index 996bd01fb9ac8a372191632b1c86d91c850e5cf6..4b8380c2d648559e7a9b6e5b875a10bb0ec50e39 100644 (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 },
 };
 
index a0329260157a09caf9e63ce9c2a6e6615ae08f41..554631aa279b55418de569697d453b42b8069815 100644 (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 },
 };
 
index 016b596e03b300d84e7c3d69be459934c9756647..914eddd0ae1529278f77925b214bc73979b689e4 100644 (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 },
 };