Skip to contentSkip to conversation

ddr: socfpga: gen5: constify altera_gen5_sdram_ops

PATCH New Simon Goldschmidt 2 participants 2 messages Oct 23, 2019 – Oct 24, 2019

lore
Share & tools
lore
#0 lore raw

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.

---

 drivers/ddr/altera/sdram_gen5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ddr/altera/sdram_gen5.c +1 -1
index fcd89b619d..8c8ea19eb9 100644
@@ -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
#1 lore raw

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.

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
index fcd89b619d..8c8ea19eb9 100644
@@ -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,
 };