mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/2] clk: pistachio: Fix initconst confusion
@ 2022-07-08  7:13 Jiri Slaby
  2022-07-08  7:13 ` [PATCH v2 2/2] clk: renesas: rcar-gen4: Fix initconst confusion for cpg_pll_config Jiri Slaby
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Slaby @ 2022-07-08  7:13 UTC (permalink / raw)
  To: mturquette
  Cc: linux-kernel, Andi Kleen, Stephen Boyd, linux-clk, Martin Liska,
	Jiri Slaby

From: Andi Kleen <ak@linux.intel.com>

A variable pointing to const isn't const itself. It has to contain
"const" keyword after "*" too. So to keep it in __initconst (and not
mark properly as __initdata), add the "const" keyword exactly there.

Note we need to update struct pistachio_mux too. On the other hand, the
clk core already counts with "const char *const" already.

[js] more explanatory commit message.

Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Cc: Martin Liska <mliska@suse.cz>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---

Notes:
    [v2] as suggested by Stephen, instead of switching to __initdata, make
         it real const

 drivers/clk/pistachio/clk.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/pistachio/clk.h b/drivers/clk/pistachio/clk.h
index f9c31e3a0e47..2f4ffbd98282 100644
--- a/drivers/clk/pistachio/clk.h
+++ b/drivers/clk/pistachio/clk.h
@@ -31,10 +31,10 @@ struct pistachio_mux {
 	unsigned int shift;
 	unsigned int num_parents;
 	const char *name;
-	const char **parents;
+	const char *const *parents;
 };
 
-#define PNAME(x) static const char *x[] __initconst
+#define PNAME(x) static const char *const x[] __initconst
 
 #define MUX(_id, _name, _pnames, _reg, _shift)			\
 	{							\
-- 
2.36.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2 2/2] clk: renesas: rcar-gen4: Fix initconst confusion for cpg_pll_config
  2022-07-08  7:13 [PATCH v2 1/2] clk: pistachio: Fix initconst confusion Jiri Slaby
@ 2022-07-08  7:13 ` Jiri Slaby
  2022-07-08  7:27   ` Geert Uytterhoeven
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Slaby @ 2022-07-08  7:13 UTC (permalink / raw)
  To: mturquette
  Cc: linux-kernel, Andi Kleen, Geert Uytterhoeven, linux-renesas-soc,
	linux-clk, Martin Liska, Stephen Boyd, Jiri Slaby

From: Andi Kleen <ak@linux.intel.com>

A variable pointing to const isn't const itself. It'd have to contain
"const" keyword after "*" too. Therefore, cpg_pll_config cannot be put
to "rodata".  Hence use __initdata instead of __initconst to fix this.

[js] more explanatory commit message.

Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-clk@vger.kernel.org
Cc: Martin Liska <mliska@suse.cz>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/clk/renesas/rcar-gen4-cpg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/renesas/rcar-gen4-cpg.c b/drivers/clk/renesas/rcar-gen4-cpg.c
index c7ed43d6aa67..e27832e5114f 100644
--- a/drivers/clk/renesas/rcar-gen4-cpg.c
+++ b/drivers/clk/renesas/rcar-gen4-cpg.c
@@ -23,7 +23,7 @@
 #include "rcar-gen4-cpg.h"
 #include "rcar-cpg-lib.h"
 
-static const struct rcar_gen4_cpg_pll_config *cpg_pll_config __initconst;
+static const struct rcar_gen4_cpg_pll_config *cpg_pll_config __initdata;
 static unsigned int cpg_clk_extalr __initdata;
 static u32 cpg_mode __initdata;
 
-- 
2.36.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 2/2] clk: renesas: rcar-gen4: Fix initconst confusion for cpg_pll_config
  2022-07-08  7:13 ` [PATCH v2 2/2] clk: renesas: rcar-gen4: Fix initconst confusion for cpg_pll_config Jiri Slaby
@ 2022-07-08  7:27   ` Geert Uytterhoeven
  0 siblings, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2022-07-08  7:27 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Michael Turquette, Linux Kernel Mailing List, Andi Kleen,
	Geert Uytterhoeven, Linux-Renesas, linux-clk, Martin Liska,
	Stephen Boyd

Hi Jiri,

On Fri, Jul 8, 2022 at 9:13 AM Jiri Slaby <jslaby@suse.cz> wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> A variable pointing to const isn't const itself. It'd have to contain
> "const" keyword after "*" too. Therefore, cpg_pll_config cannot be put
> to "rodata".  Hence use __initdata instead of __initconst to fix this.
>
> [js] more explanatory commit message.
>
> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Michael Turquette <mturquette@baylibre.com>
> Cc: linux-renesas-soc@vger.kernel.org
> Cc: linux-clk@vger.kernel.org
> Cc: Martin Liska <mliska@suse.cz>
> Acked-by: Stephen Boyd <sboyd@kernel.org>
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>

Already queued as commit 0e704f6c42dc64f0 ("clk: renesas: rcar-gen4:
Fix initconst confusion for cpg_pll_config") in renesas-clk-for-v5.20,
and next-20220706 and later.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-08  7:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-08  7:13 [PATCH v2 1/2] clk: pistachio: Fix initconst confusion Jiri Slaby
2022-07-08  7:13 ` [PATCH v2 2/2] clk: renesas: rcar-gen4: Fix initconst confusion for cpg_pll_config Jiri Slaby
2022-07-08  7:27   ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®