of_irq.h: fix build warnings when CONFIG_OF is not enabled
PATCH 1/1 of_irq.h: fix build warnings when CONFIG_OF is not enabled
From: Randy Dunlap <[email protected]>
Fix build warnings when CONFIG_OF is not enabled:
include/linux/of_irq.h:82:7: warning: 'struct device_node' declared inside parameter list [enabled by default] include/linux/of_irq.h:82:7: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] include/linux/of_irq.h:87:47: warning: 'struct device_node' declared inside parameter list [enabled by default]
--- include/linux/of_irq.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/of_irq.h +2 -0
@@ -78,6 +78,8 @@ extern void of_irq_init(const struct of_#endif /* CONFIG_OF_IRQ */ #else /* !CONFIG_OF */ +struct device_node ; +static inline unsigned int irq_of_parse_and_map (struct device_node *dev,int index) {
Quoted 3 lines · Randy Dunlap
From: Randy Dunlap <[email protected]>
Fix build warnings when
CONFIG_OFis not enabled:
It would be nice to know what arch/config you see this on.
Quoted 15 lines
include/linux/of_irq.h:82:7: warning: 'structdevice_node' declared inside parameter list [enabled by default]include/linux/of_irq.h:82:7: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]include/linux/of_irq.h:87:47: warning: 'structdevice_node' declared inside parameter list [enabled by default]Signed-off-by Randy Dunlap <[email protected]>Cc: Grant Likely <[email protected]> Cc: Rob Herring <[email protected]> Cc: [email protected] --- include/linux/of_irq.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/of_irq.h extern void of_irq_init(const struct of_ · line 81
Quoted 4 lines
include/linux/of_irq.h +1
-0@@ -78,6 +78,8 @@ extern void of_irq_init(const struct of_#endif /* CONFIG_OF_IRQ */ #else /* !CONFIG_OF */ +struct device_node ;
Can you move this outside of the ifdefs to minimize the amount of ifdef'ed code.
Rob
Quoted 6 lines · Rob Herring
Quoted 3 lines · Randy Dunlap
From: Randy Dunlap <[email protected]>
Fix build warnings when
CONFIG_OFis not enabled:It would be nice to know what
arch/configyou see this on.
i386 and x86_64.
Quoted 18 lines
Quoted 18 lines
include/linux/of_irq.h:82:7: warning: 'structdevice_node' declared inside parameter list [enabled by default]include/linux/of_irq.h:82:7: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]include/linux/of_irq.h:87:47: warning: 'structdevice_node' declared inside parameter list [enabled by default]Signed-off-by Randy Dunlap <[email protected]>Cc: Grant Likely <[email protected]> Cc: Rob Herring <[email protected]> Cc: [email protected] --- include/linux/of_irq.h | 2 ++ 1 file changed, 2 insertions(+)include/linux/of_irq.h +0
-0@@ -78,6 +78,8 @@ extern void of_irq_init(const struct of_#endif /* CONFIG_OF_IRQ */
Quoted 4 lines
include/linux/of_irq.h extern void of_irq_init(const struct of_ · line 81
Quoted 2 lines
include/linux/of_irq.h +1
-0#else /* !CONFIG_OF */ +struct device_node ;Can you move this outside of the ifdefs to minimize the amount of ifdef'ed code.
I'm build testing that change now, but it seems odd to have it there in 2 ways when CONFIG_OF is enabled:
struct device_node;
#if defined(CONFIG_OF)
#include <linux/of.h>
will resend the patch shortly.
Signature · 1 line
~Randy
PATCH v2 1/1 of_irq.h: fix build warnings when CONFIG_OF is not enabled
In reply to Rob HerringFrom: Randy Dunlap <[email protected]>
Fix build warnings when CONFIG_OF is not enabled:
(seen on i386 and x86_64)
include/linux/of_irq.h:82:7: warning: 'struct device_node' declared inside parameter list [enabled by default] include/linux/of_irq.h:82:7: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] include/linux/of_irq.h:87:47: warning: 'struct device_node' declared inside parameter list [enabled by default]
--- include/linux/of_irq.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/of_irq.h +2 -0
@@ -1,6 +1,8 @@#ifndef __OF_IRQ_H#define __OF_IRQ_H +struct device_node ; +#if defined(CONFIG_OF )struct of_irq ;#include <linux/types.h>