ddr: socfpga: gen5: constify altera_gen5_sdram_ops
PATCH 1/1 ddr: socfpga: gen5: constify altera_gen5_sdram_ops
Make the function pointer struct const, as it does not need to be writable. This doesn't really change anything other than moving this variable to a different section. No functional change.
Signed-off-by Simon Goldschmidt <[email protected]>
---
drivers/ddr/altera/sdram_gen5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ddr/altera/sdram_gen5.c +1 -1
@@ -626,7 +626,7 @@ static int altera_gen5_sdram_get_info(struct udevice *dev,return 0 ; } -static struct ram_ops altera_gen5_sdram_ops = { +static const struct ram_ops altera_gen5_sdram_ops = { .get_info = altera_gen5_sdram_get_info, };
Signature · 1 line
2.20.1
PATCH 1/1 ddr: socfpga: gen5: constify altera_gen5_sdram_ops
Quoted 5 lines · Simon Goldschmidt
Make the function pointer struct const, as it does not need to be writable. This doesn't really change anything other than moving this variable to a different section. No functional change.
Signed-off-by Simon Goldschmidt <[email protected]>
Reviewed-by Ley Foon Tan <[email protected]>
Quoted 20 lines
---
drivers/ddr/altera/sdram_gen5.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)drivers/ddr/altera/sdram_gen5.c +0
-0@@ -626,7 +626,7 @@ static int altera_gen5_sdram_get_info(struct udevice *dev, return 0; }drivers/ddr/altera/sdram_gen5.c +1
-1-static struct ram_ops altera_gen5_sdram_ops = { +static const struct ram_ops altera_gen5_sdram_ops = {.get_info =
altera_gen5_sdram_get_info,
};