clk: renesas: rcar-gen4: Initial clock descriptions should be __initconst
Subsystems (2)
Geert Uytterhoeven
maintainercover clk: renesas: rcar-gen4: Initial clock descriptions should be __initconst
Hi all,
The various R-Car Gen4 clock drivers missed a few opportunities to put constant clock description data in the __init section. Fix this to reduce memory consumption.
To be queued in renesas-clk-for-v6.12 (unless I get to doing a fixes branch for v6.11).
Thanks for your comments!
Geert Uytterhoeven (4):
clk: renesas: r8a779a0: cpg_pll_configs should be __initconst
clk: renesas: r8a779f0: cpg_pll_configs should be __initconst
clk: renesas: r8a779g0: cpg_pll_configs should be __initconst
clk: renesas: r8a779h0: Initial clock descriptions should be
__initconst
drivers/clk/renesas/r8a779a0-cpg-mssr.c | 2 +- drivers/clk/renesas/r8a779f0-cpg-mssr.c | 2 +- drivers/clk/renesas/r8a779g0-cpg-mssr.c | 2 +- drivers/clk/renesas/r8a779h0-cpg-mssr.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-)
Signature · 12 lines
2.34.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus TorvaldsGeert Uytterhoeven
maintainerPATCH 1/4 clk: renesas: r8a779a0: cpg_pll_configs should be __initconst
cpg_pll_configs[] is only used during initialization. Hence make it __initconst, so it will be freed later.
--- drivers/clk/renesas/r8a779a0-cpg-mssr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/renesas/r8a779a0-cpg-mssr.c +1 -1
@@ -253,7 +253,7 @@ static const unsigned int r8a779a0_crit_mod_clks[] __initconst = {*/ #define CPG_PLL_CONFIG_INDEX (md) ((((md) & BIT(14)) >> 13) | \ (((md) & BIT(13)) >> 13)) -static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4 ] = { +static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4 ]__initconst = {/* EXTAL div PLL1 mult/div PLL2 mult/div PLL3 mult/div PLL4 mult/div PLL5 mult/div PLL6 mult/div OSC prediv */ {1 ,128 ,1 ,0 ,0 ,0 ,0 ,144 ,1 ,192 ,1 ,0 ,0 ,16 , }, {1 ,106 ,1 ,0 ,0 ,0 ,0 ,120 ,1 ,160 ,1 ,0 ,0 ,19 , },
Signature · 1 line
2.34.1
Geert Uytterhoeven
maintainerPATCH 2/4 clk: renesas: r8a779f0: cpg_pll_configs should be __initconst
In reply to Geert Uytterhoevencpg_pll_configs[] is only used during initialization. Hence make it __initconst, so it will be freed later.
--- drivers/clk/renesas/r8a779f0-cpg-mssr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/renesas/r8a779f0-cpg-mssr.c +1 -1
@@ -187,7 +187,7 @@ static const unsigned int r8a779f0_crit_mod_clks[] __initconst = {#define CPG_PLL_CONFIG_INDEX (md) ((((md) & BIT(14)) >> 13) | \ (((md) & BIT(13)) >> 13)) -static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4 ] = { +static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4 ]__initconst = {/* EXTAL div PLL1 mult/div PLL2 mult/div PLL3 mult/div PLL4 mult/div PLL5 mult/div PLL6 mult/div OSC prediv */ {1 ,200 ,1 ,150 ,1 ,200 ,1 ,0 ,0 ,200 ,1 ,134 ,1 ,15 , }, {1 ,160 ,1 ,120 ,1 ,160 ,1 ,0 ,0 ,160 ,1 ,106 ,1 ,19 , },
Signature · 1 line
2.34.1
Geert Uytterhoeven
maintainerPATCH 3/4 clk: renesas: r8a779g0: cpg_pll_configs should be __initconst
In reply to Geert Uytterhoevencpg_pll_configs[] is only used during initialization. Hence make it __initconst, so it will be freed later.
--- drivers/clk/renesas/r8a779g0-cpg-mssr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/renesas/r8a779g0-cpg-mssr.c +1 -1
@@ -258,7 +258,7 @@ static const struct mssr_mod_clk r8a779g0_mod_clks[] __initconst = {#define CPG_PLL_CONFIG_INDEX (md) ((((md) & BIT(14)) >> 13) | \ (((md) & BIT(13)) >> 13)) -static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4 ] = { +static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4 ]__initconst = {/* EXTAL div PLL1 mult/div PLL2 mult/div PLL3 mult/div PLL4 mult/div PLL5 mult/div PLL6 mult/div OSC prediv */ {1 ,192 ,1 ,204 ,1 ,192 ,1 ,144 ,1 ,192 ,1 ,168 ,1 ,16 , }, {1 ,160 ,1 ,170 ,1 ,160 ,1 ,120 ,1 ,160 ,1 ,140 ,1 ,19 , },
Signature · 1 line
2.34.1
Geert Uytterhoeven
maintainerPATCH 4/4 clk: renesas: r8a779h0: Initial clock descriptions should be __initconst
In reply to Geert Uytterhoevenr8a779h0_core_clks[], r8a779h0_mod_clks[], and cpg_pll_configs[] are only used during initialization. Hence make them __initconst, so they will be freed later.
--- drivers/clk/renesas/r8a779h0-cpg-mssr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/renesas/r8a779h0-cpg-mssr.c +3 -3
@@ -63,7 +63,7 @@ enum clk_ids {MOD_CLK_BASE }; -static const struct cpg_core_clk r8a779h0_core_clks[] = { +static const struct cpg_core_clk r8a779h0_core_clks[]__initconst = {/* External Clock Inputs */ DEF_INPUT ("extal" ,CLK_EXTAL ),DEF_INPUT ("extalr" ,CLK_EXTALR ),
@@ -172,7 +172,7 @@ static const struct cpg_core_clk r8a779h0_core_clks[] = { DEF_GEN4_MDSEL("r", R8A779H0_CLK_R, 29, CLK_EXTALR, 1, CLK_OCO, 1), }; -static const struct mssr_mod_clk r8a779h0_mod_clks[] = { +static const struct mssr_mod_clk r8a779h0_mod_clks[]__initconst = {DEF_MOD ("avb0:rgmii0" ,211 ,R8A779H0_CLK_S0D8_HSC ),DEF_MOD ("avb1:rgmii1" ,212 ,R8A779H0_CLK_S0D8_HSC ),DEF_MOD ("avb2:rgmii2" ,213 ,R8A779H0_CLK_S0D8_HSC ),
@@ -253,7 +253,7 @@ static const struct mssr_mod_clk r8a779h0_mod_clks[] = {#define CPG_PLL_CONFIG_INDEX (md) ((((md) & BIT(14)) >> 13) | \ (((md) & BIT(13)) >> 13)) -static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4 ] = { +static const struct rcar_gen4_cpg_pll_config cpg_pll_configs[4 ]__initconst = {/* EXTAL div PLL1 mult/div PLL2 mult/div PLL3 mult/div PLL4 mult/div PLL5 mult/div PLL6 mult/div OSC prediv */ {1 ,192 ,1 ,240 ,1 ,192 ,1 ,240 ,1 ,192 ,1 ,168 ,1 ,16 , }, {1 ,160 ,1 ,200 ,1 ,160 ,1 ,200 ,1 ,160 ,1 ,140 ,1 ,19 , },
Signature · 1 line
2.34.1
Hi Geert,
Thanks for your work.
Quoted 10 lines · Geert Uytterhoeven
Hi all,
The various R-Car Gen4 clock drivers missed a few opportunities to put constant clock description data in the
__initsection. Fix this to reduce memory consumption.To be queued in renesas-clk-for-v6.12 (unless I get to doing a fixes branch for v6.11).
Thanks for your comments!
For the whole series,
Quoted 27 lines
Geert Uytterhoeven (4):
clk: renesas: r8a779a0:cpg_pll_configsshould be__initconst
clk: renesas: r8a779f0:cpg_pll_configsshould be__initconst
clk: renesas: r8a779g0:cpg_pll_configsshould be__initconst
clk: renesas: r8a779h0: Initial clock descriptions should be
__initconstdrivers/clk/renesas/r8a779a0-cpg-mssr.c | 2 +- drivers/clk/renesas/r8a779f0-cpg-mssr.c | 2 +- drivers/clk/renesas/r8a779g0-cpg-mssr.c | 2 +- drivers/clk/renesas/r8a779h0-cpg-mssr.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-)Signature · 12 lines
2.34.1 Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Signature · 2 lines
Kind Regards, Niklas Söderlund