diff mbox series

[U-Boot] ddr: socfpga: gen5: constify altera_gen5_sdram_ops

Message ID 20191023201937.24669-1-simon.k.r.goldschmidt@gmail.com
State Accepted, archived
Commit aacd7b922f052a53c34e3b2d2c92bac27e16dad5
Delegated to: Simon Goldschmidt
Headers show
Series [U-Boot] ddr: socfpga: gen5: constify altera_gen5_sdram_ops | expand

Commit Message

Simon Goldschmidt Oct. 23, 2019, 8:19 p.m. UTC
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 <simon.k.r.goldschmidt@gmail.com>
---

 drivers/ddr/altera/sdram_gen5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ley Foon Tan Oct. 24, 2019, 2:55 a.m. UTC | #1
On Wed, 2019-10-23 at 22:19 +0200, Simon Goldschmidt wrote:
> 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 <simon.k.r.goldschmidt@gmail.com>
Reviewed-by: Ley Foon Tan <ley.foon.tan@intel.com>
> ---
> 
>  drivers/ddr/altera/sdram_gen5.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ddr/altera/sdram_gen5.c
> b/drivers/ddr/altera/sdram_gen5.c
> index fcd89b619d..8c8ea19eb9 100644
> --- a/drivers/ddr/altera/sdram_gen5.c
> +++ b/drivers/ddr/altera/sdram_gen5.c
> @@ -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,
>  };
>
diff mbox series

Patch

diff --git a/drivers/ddr/altera/sdram_gen5.c b/drivers/ddr/altera/sdram_gen5.c
index fcd89b619d..8c8ea19eb9 100644
--- a/drivers/ddr/altera/sdram_gen5.c
+++ b/drivers/ddr/altera/sdram_gen5.c
@@ -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,
 };