From: Chen-Yu Tsai Date: Tue, 24 Mar 2026 16:43:51 +0000 (+0800) Subject: soc: sunxi: sram: Const-ify sunxi_sram_func data and references X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7765752f528b5b516d8cdf94faaabcba935dff41;p=thirdparty%2Flinux.git soc: sunxi: sram: Const-ify sunxi_sram_func data and references sunxi_sram_func contains value mapping that do not change at runtime. Const-ify them. Reviewed-by: Jernej Skrabec Link: https://patch.msgid.link/20260324164357.1607247-4-wens@kernel.org Signed-off-by: Chen-Yu Tsai --- diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c index 446b9fc1f1759..5e8c80ae35094 100644 --- a/drivers/soc/sunxi/sunxi_sram.c +++ b/drivers/soc/sunxi/sunxi_sram.c @@ -29,11 +29,11 @@ struct sunxi_sram_func { }; struct sunxi_sram_data { - char *name; - u8 reg; - u8 offset; - u8 width; - struct sunxi_sram_func *func; + char *name; + u8 reg; + u8 offset; + u8 width; + const struct sunxi_sram_func *func; }; struct sunxi_sram_desc { @@ -54,7 +54,7 @@ struct sunxi_sram_desc { .reg = _reg, \ .offset = _off, \ .width = _width, \ - .func = (struct sunxi_sram_func[]){ \ + .func = (const struct sunxi_sram_func[]){ \ __VA_ARGS__, { } }, \ } @@ -111,7 +111,7 @@ static int sunxi_sram_show(struct seq_file *s, void *data) struct device_node *sram_node, *section_node; const struct sunxi_sram_data *sram_data; const struct of_device_id *match; - struct sunxi_sram_func *func; + const struct sunxi_sram_func *func; const __be32 *sram_addr_p, *section_addr_p; u32 val; @@ -169,7 +169,7 @@ static const struct sunxi_sram_data *sunxi_sram_of_parse(struct device_node *nod { const struct of_device_id *match; const struct sunxi_sram_data *data; - struct sunxi_sram_func *func; + const struct sunxi_sram_func *func; struct of_phandle_args args; u8 val; int ret;