ARM: prima2: Constify static sirfsoc_rstc_ops
Subsystems (2)
PATCH 1/1 ARM: prima2: Constify static sirfsoc_rstc_ops
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 <[email protected]>
--- arch/arm/mach-prima2/rstc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-prima2/rstc.c +1 -1
@@ -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, };
Signature · 1 line
2.28.0
Hi Rikard,
Quoted 5 lines · Rikard Falkeborn
The only usage of
sirfsoc_rstc_opsis to assign its address to the ops field in thereset_controller_devstruct, which is a const pointer. Make it const to allow the compiler to put it in read-only memory.Signed-off-by Rikard Falkeborn <[email protected]>
Reviewed-by Philipp Zabel <[email protected]>
Quoted 9 lines
--- arch/arm/mach-prima2/rstc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/arm/mach-prima2/rstc.c +0
-0
arch/arm/mach-prima2/rstc.c static int sirfsoc_reset_module(struct reset_controller_dev *rcdev, · line 59
Quoted 8 lines
arch/arm/mach-prima2/rstc.c +1
-1@@ -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