All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Partially Revert "of: fix sparse warnings in fdt, irq, reserved mem, and resolver code"
@ 2017-05-11 15:30 Rob Herring
  2017-05-11 15:44 ` Arnd Bergmann
  2017-05-17 14:41   ` Geert Uytterhoeven
  0 siblings, 2 replies; 4+ messages in thread
From: Rob Herring @ 2017-05-11 15:30 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: devicetree, linux-kernel, Frank Rowand, Marek Szyprowski

A change to function pointers that was meant to address a sparse warning
turned out to cause hundreds of new gcc-7 warnings:

include/linux/of_irq.h:11:13: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
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;

Turns out the sparse warnings were spurious and have been fixed in
upstream sparse since 0.5.0 in commit "sparse: treat function pointers
as pointers to const data".

This partially reverts commit 17a70355ea576843a7ac851f1db26872a50b2850.

Fixes: 17a70355ea57 ("of: fix sparse warnings in fdt, irq, reserved mem, and resolver code")
Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rob Herring <robh@kernel.org>
---
Arnd,

Doing this as a partial revert instead and added sparse version 
information to the commit msg.

Rob

 drivers/of/of_reserved_mem.c | 2 +-
 include/linux/of_irq.h       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 4dec07ea510f..d507c3569a88 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;
+		reservedmem_of_init_fn initfn = i->data;
 		const char *compat = i->compatible;
 
 		if (!of_flat_dt_is_compatible(rmem->fdt_node, compat))
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index ec6b11deb773..1e0deb8e8494 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -8,7 +8,7 @@
 #include <linux/ioport.h>
 #include <linux/of.h>
 
-typedef int const (*of_irq_init_cb_t)(struct device_node *, struct device_node *);
+typedef int (*of_irq_init_cb_t)(struct device_node *, struct device_node *);
 
 /*
  * Workarounds only applied to 32bit powermac machines
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Partially Revert "of: fix sparse warnings in fdt, irq, reserved mem, and resolver code"
  2017-05-11 15:30 [PATCH] Partially Revert "of: fix sparse warnings in fdt, irq, reserved mem, and resolver code" Rob Herring
@ 2017-05-11 15:44 ` Arnd Bergmann
  2017-05-17 14:41   ` Geert Uytterhoeven
  1 sibling, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2017-05-11 15:44 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Linux Kernel Mailing List, Frank Rowand, Marek Szyprowski

On Thu, May 11, 2017 at 5:30 PM, Rob Herring <robh@kernel.org> wrote:
> A change to function pointers that was meant to address a sparse warning
> turned out to cause hundreds of new gcc-7 warnings:
>
> include/linux/of_irq.h:11:13: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
> 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;
>
> Turns out the sparse warnings were spurious and have been fixed in
> upstream sparse since 0.5.0 in commit "sparse: treat function pointers
> as pointers to const data".
>
> This partially reverts commit 17a70355ea576843a7ac851f1db26872a50b2850.
>
> Fixes: 17a70355ea57 ("of: fix sparse warnings in fdt, irq, reserved mem, and resolver code")
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> Arnd,
>
> Doing this as a partial revert instead and added sparse version
> information to the commit msg.

Looks good, thanks!

      Arnd

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Partially Revert "of: fix sparse warnings in fdt, irq, reserved mem, and resolver code"
@ 2017-05-17 14:41   ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2017-05-17 14:41 UTC (permalink / raw)
  To: Rob Herring
  Cc: Arnd Bergmann, devicetree, linux-kernel, Frank Rowand, Marek Szyprowski

Hi Rob,

On Thu, May 11, 2017 at 5:30 PM, Rob Herring <robh@kernel.org> wrote:
> A change to function pointers that was meant to address a sparse warning
> turned out to cause hundreds of new gcc-7 warnings:
>
> include/linux/of_irq.h:11:13: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
> 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;

Not just gcc-7. Also with the good old 4.1.2 ;-)

> Turns out the sparse warnings were spurious and have been fixed in
> upstream sparse since 0.5.0 in commit "sparse: treat function pointers
> as pointers to const data".
>
> This partially reverts commit 17a70355ea576843a7ac851f1db26872a50b2850.
>
> Fixes: 17a70355ea57 ("of: fix sparse warnings in fdt, irq, reserved mem, and resolver code")
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Rob Herring <robh@kernel.org>

Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Partially Revert "of: fix sparse warnings in fdt, irq, reserved mem, and resolver code"
@ 2017-05-17 14:41   ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2017-05-17 14:41 UTC (permalink / raw)
  To: Rob Herring
  Cc: Arnd Bergmann, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Frank Rowand,
	Marek Szyprowski

Hi Rob,

On Thu, May 11, 2017 at 5:30 PM, Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> A change to function pointers that was meant to address a sparse warning
> turned out to cause hundreds of new gcc-7 warnings:
>
> include/linux/of_irq.h:11:13: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
> 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;

Not just gcc-7. Also with the good old 4.1.2 ;-)

> Turns out the sparse warnings were spurious and have been fixed in
> upstream sparse since 0.5.0 in commit "sparse: treat function pointers
> as pointers to const data".
>
> This partially reverts commit 17a70355ea576843a7ac851f1db26872a50b2850.
>
> Fixes: 17a70355ea57 ("of: fix sparse warnings in fdt, irq, reserved mem, and resolver code")
> Reported-by: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
> Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

Acked-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-17 14:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-11 15:30 [PATCH] Partially Revert "of: fix sparse warnings in fdt, irq, reserved mem, and resolver code" Rob Herring
2017-05-11 15:44 ` Arnd Bergmann
2017-05-17 14:41 ` Geert Uytterhoeven
2017-05-17 14:41   ` Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.