linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: renesas: Constify sh73a0_vccq_mc0_ops
@ 2020-11-09 22:10 Rikard Falkeborn
  2020-11-10  8:00 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Rikard Falkeborn @ 2020-11-09 22:10 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Geert Uytterhoeven, linux-renesas-soc, linux-gpio, linux-kernel,
	Rikard Falkeborn

The only usage of sh73a0_vccq_mc0_ops is to assign its address to the
ops field in the regulator_desc struct, which is a const pointer. Make
it const to allow the compiler to put it in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 drivers/pinctrl/renesas/pfc-sh73a0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/renesas/pfc-sh73a0.c b/drivers/pinctrl/renesas/pfc-sh73a0.c
index afabd95105d5..96b91e95b1e1 100644
--- a/drivers/pinctrl/renesas/pfc-sh73a0.c
+++ b/drivers/pinctrl/renesas/pfc-sh73a0.c
@@ -4279,7 +4279,7 @@ static int sh73a0_vccq_mc0_get_voltage(struct regulator_dev *reg)
 	return 3300000;
 }
 
-static struct regulator_ops sh73a0_vccq_mc0_ops = {
+static const struct regulator_ops sh73a0_vccq_mc0_ops = {
 	.enable = sh73a0_vccq_mc0_enable,
 	.disable = sh73a0_vccq_mc0_disable,
 	.is_enabled = sh73a0_vccq_mc0_is_enabled,
-- 
2.29.2


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

* Re: [PATCH] pinctrl: renesas: Constify sh73a0_vccq_mc0_ops
  2020-11-09 22:10 [PATCH] pinctrl: renesas: Constify sh73a0_vccq_mc0_ops Rikard Falkeborn
@ 2020-11-10  8:00 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2020-11-10  8:00 UTC (permalink / raw)
  To: Rikard Falkeborn
  Cc: Linus Walleij, Linux-Renesas, open list:GPIO SUBSYSTEM,
	Linux Kernel Mailing List

On Mon, Nov 9, 2020 at 11:10 PM Rikard Falkeborn
<rikard.falkeborn@gmail.com> wrote:
> The only usage of sh73a0_vccq_mc0_ops is to assign its address to the
> ops field in the regulator_desc struct, which is a const pointer. Make
> it const to allow the compiler to put it in read-only memory.
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-pinctrl-for-v5.11.

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] 2+ messages in thread

end of thread, other threads:[~2020-11-10  8:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09 22:10 [PATCH] pinctrl: renesas: Constify sh73a0_vccq_mc0_ops Rikard Falkeborn
2020-11-10  8:00 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).