Message ID | 20200929201738.349465-1-rikard.falkeborn@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | ARM: prima2: Constify static sirfsoc_rstc_ops | expand |
Hi Rikard, On Tue, 2020-09-29 at 22:17 +0200, Rikard Falkeborn wrote: > The only usage of sirfsoc_rstc_ops is to assign its address to the ops > field in the reset_controller_dev 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: Philipp Zabel <p.zabel@pengutronix.de> > --- > arch/arm/mach-prima2/rstc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c > index 9d56606ac87f..1ee405e2dde9 100644 > --- a/arch/arm/mach-prima2/rstc.c > +++ b/arch/arm/mach-prima2/rstc.c > @@ -53,7 +53,7 @@ static int sirfsoc_reset_module(struct reset_controller_dev *rcdev, > return 0; > } > > -static struct reset_control_ops sirfsoc_rstc_ops = { > +static const struct reset_control_ops sirfsoc_rstc_ops = { > .reset = sirfsoc_reset_module, > }; > regards Philipp
diff --git a/arch/arm/mach-prima2/rstc.c b/arch/arm/mach-prima2/rstc.c index 9d56606ac87f..1ee405e2dde9 100644 --- a/arch/arm/mach-prima2/rstc.c +++ b/arch/arm/mach-prima2/rstc.c @@ -53,7 +53,7 @@ static int sirfsoc_reset_module(struct reset_controller_dev *rcdev, return 0; } -static struct reset_control_ops sirfsoc_rstc_ops = { +static const struct reset_control_ops sirfsoc_rstc_ops = { .reset = sirfsoc_reset_module, };
The only usage of sirfsoc_rstc_ops is to assign its address to the ops field in the reset_controller_dev 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> --- arch/arm/mach-prima2/rstc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)