It's the pointer that is supposed to be const, not the return
type of the function.

drivers/of/of_reserved_mem.c: In function '__reserved_mem_init_node':
drivers/of/of_reserved_mem.c:200:7: error: type qualifiers ignored on function 
return type [-Werror=ignored-qualifiers]
   int const (*initfn)(struct reserved_mem *rmem) = i->data;

Fixes: 17a70355ea57 ("of: fix sparse warnings in fdt, irq, reserved mem, and 
resolver code")
Signed-off-by: Arnd Bergmann <a...@arndb.de>
---
 drivers/of/of_reserved_mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 4dec07ea510f..3f03ec004829 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -197,7 +197,7 @@ static int __init __reserved_mem_init_node(struct 
reserved_mem *rmem)
        const struct of_device_id *i;
 
        for (i = __reservedmem_of_table; i < &__rmem_of_table_sentinel; i++) {
-               int const (*initfn)(struct reserved_mem *rmem) = i->data;
+               int (* const initfn)(struct reserved_mem *rmem) = i->data;
                const char *compat = i->compatible;
 
                if (!of_flat_dt_is_compatible(rmem->fdt_node, compat))
-- 
2.9.0

Reply via email to