Skip to contentSkip to conversation

arm: socfpga: make config structs const

PATCH New Simon Goldschmidt 2 participants 2 messages Nov 14, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: socfpga: make config structs const

There are two config structs left in wrap_sdram_config.c that can be made const.

---

 arch/arm/mach-socfpga/wrap_sdram_config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-socfpga/wrap_sdram_config.c +2 -2
index 8cfacc7a13..2b072cc65e 100644
@@ -251,7 +251,7 @@ static const struct socfpga_sdram_rw_mgr_config rw_mgr_config = {
 		RW_MGR_MEM_VIRTUAL_GROUPS_PER_WRITE_DQS,
 };
 
-struct socfpga_sdram_io_config io_config = {
+static const struct socfpga_sdram_io_config io_config = {
 	.delay_per_dchain_tap		= IO_DELAY_PER_DCHAIN_TAP,
 	.delay_per_dqs_en_dchain_tap	= IO_DELAY_PER_DQS_EN_DCHAIN_TAP,
 	.delay_per_opa_tap		= IO_DELAY_PER_OPA_TAP,
@@ -269,7 +269,7 @@ struct socfpga_sdram_io_config io_config = {
 	.shift_dqs_en_when_shift_dqs	= IO_SHIFT_DQS_EN_WHEN_SHIFT_DQS,
 };
 
-struct socfpga_sdram_misc_config misc_config = {
+static const struct socfpga_sdram_misc_config misc_config = {
 	.afi_rate_ratio			= AFI_RATE_RATIO,
 	.calib_lfifo_offset		= CALIB_LFIFO_OFFSET,
 	.calib_vfifo_offset		= CALIB_VFIFO_OFFSET,
Signature · 1 line
2.17.1
Applied
#1 lore raw

PATCH 1/1 arm: socfpga: make config structs const

Quoted 24 lines · Simon Goldschmidt

There are two config structs left in wrap_sdram_config.c that can be made const.

---

 arch/arm/mach-socfpga/wrap_sdram_config.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-socfpga/wrap_sdram_config.c +1 -1
index 8cfacc7a13..2b072cc65e 100644
@@ -251,7 +251,7 @@ static const struct socfpga_sdram_rw_mgr_config rw_mgr_config = {
 		RW_MGR_MEM_VIRTUAL_GROUPS_PER_WRITE_DQS,
 };
 
-struct socfpga_sdram_io_config io_config = {
+static const struct socfpga_sdram_io_config io_config = {
 	.delay_per_dchain_tap		= IO_DELAY_PER_DCHAIN_TAP,
 	.delay_per_dqs_en_dchain_tap	= IO_DELAY_PER_DQS_EN_DCHAIN_TAP,
 	.delay_per_opa_tap		= IO_DELAY_PER_OPA_TAP,

arch/arm/mach-socfpga/wrap_sdram_config.c struct socfpga_sdram_io_config io_config = { · line 275

Quoted 8 lines
arch/arm/mach-socfpga/wrap_sdram_config.c +1 -1
@@ -269,7 +269,7 @@ struct socfpga_sdram_io_config io_config = {
 	.shift_dqs_en_when_shift_dqs	= IO_SHIFT_DQS_EN_WHEN_SHIFT_DQS,
 };
 
-struct socfpga_sdram_misc_config misc_config = {
+static const struct socfpga_sdram_misc_config misc_config = {
 	.afi_rate_ratio			= AFI_RATE_RATIO,
 	.calib_lfifo_offset		= CALIB_LFIFO_OFFSET,
 	.calib_vfifo_offset		= CALIB_VFIFO_OFFSET,

Applied, thanks

Signature · 2 lines
Best regards,
Marek Vasut