devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drivers: of: Fix of_pci.h header guard
@ 2016-06-07 17:44 Robin Murphy
       [not found] ` <cf20413cea1895fd005bf27460fe649000c09e02.1465321392.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Robin Murphy @ 2016-06-07 17:44 UTC (permalink / raw)
  To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, frowand.list-Re5JQEeQqe8AvxtiuMwx3w
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA

The compilation of of_pci.c is governed by CONFIG_OF_PCI, but the
corresponding declarations in of_pci.h are inconsistently guarded by
CONFIG_OF, with the result that if CONFIG_PCI is disabled for an OF
platform, the dangling external declarations are still active and the
inline stub definitions not. So far this has managed to go unnoticed
since it happens that the only references to these functions are from
code which itself depends on CONFIG_PCI or CONFIG_OF_PCI.

Fix this with the appropriate config guard so that any new callers
outside PCI-specific code don't start unexpectedly breaking under
certain configs.

Signed-off-by: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
---
 include/linux/of_pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h
index 070f8835780b..4224e7bb7c16 100644
--- a/include/linux/of_pci.h
+++ b/include/linux/of_pci.h
@@ -8,7 +8,7 @@ struct pci_dev;
 struct of_phandle_args;
 struct device_node;
 
-#ifdef CONFIG_OF
+#ifdef CONFIG_OF_PCI
 int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq);
 struct device_node *of_pci_find_child_device(struct device_node *parent,
 					     unsigned int devfn);
-- 
2.8.1.dirty

--
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 related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drivers: of: Fix of_pci.h header guard
       [not found] ` <cf20413cea1895fd005bf27460fe649000c09e02.1465321392.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
@ 2016-06-08 13:19   ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2016-06-08 13:19 UTC (permalink / raw)
  To: Robin Murphy
  Cc: frowand.list-Re5JQEeQqe8AvxtiuMwx3w, devicetree-u79uwXL29TY76Z2rM5mHXA

On Tue, Jun 07, 2016 at 06:44:48PM +0100, Robin Murphy wrote:
> The compilation of of_pci.c is governed by CONFIG_OF_PCI, but the
> corresponding declarations in of_pci.h are inconsistently guarded by
> CONFIG_OF, with the result that if CONFIG_PCI is disabled for an OF
> platform, the dangling external declarations are still active and the
> inline stub definitions not. So far this has managed to go unnoticed
> since it happens that the only references to these functions are from
> code which itself depends on CONFIG_PCI or CONFIG_OF_PCI.
> 
> Fix this with the appropriate config guard so that any new callers
> outside PCI-specific code don't start unexpectedly breaking under
> certain configs.
> 
> Signed-off-by: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
> ---
>  include/linux/of_pci.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Rob
--
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] 2+ messages in thread

end of thread, other threads:[~2016-06-08 13:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-07 17:44 [PATCH] drivers: of: Fix of_pci.h header guard Robin Murphy
     [not found] ` <cf20413cea1895fd005bf27460fe649000c09e02.1465321392.git.robin.murphy-5wv7dgnIgG8@public.gmane.org>
2016-06-08 13:19   ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).