]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
soc: sunxi: sram: Const-ify sunxi_sram_func data and references
authorChen-Yu Tsai <wens@kernel.org>
Tue, 24 Mar 2026 16:43:51 +0000 (00:43 +0800)
committerChen-Yu Tsai <wens@kernel.org>
Mon, 27 Apr 2026 15:25:35 +0000 (23:25 +0800)
sunxi_sram_func contains value mapping that do not change at runtime.

Const-ify them.

Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://patch.msgid.link/20260324164357.1607247-4-wens@kernel.org
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
drivers/soc/sunxi/sunxi_sram.c

index 446b9fc1f17595cf86d04dfd6daea366fc4d9dfb..5e8c80ae35094865b50c1995e4f706537c79cc65 100644 (file)
@@ -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;