Skip to contentSkip to conversation

irqchip: Add irqchip_init dummy function

PATCH New Bastian Hecht 4 participants 5 messages May 8, 2013 – May 9, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irqchip: Add irqchip_init dummy function

We add an empty irqchip_init dummy function for cases in which CONFIG_IRQCHIP is not used. In these cases irqchip.c is not compiled, but a funtion call may still be present in architecture code, that in runtime doesn't get hit.

E.g. this is needed in the arch/arm/mach-shmobile/intc-r8a7740.c interrupt setup code where OF use and non OF us is both handled in one file.

---
 include/linux/irqchip.h |    4 ++++
 1 file changed, 4 insertions(+)
include/linux/irqchip.h +4 -0
index e0006f1..78527ba 100644
@@ -11,6 +11,10 @@
 #ifndef _LINUX_IRQCHIP_H
 #define _LINUX_IRQCHIP_H
 
+#ifdef CONFIG_IRQCHIP
 void irqchip_init(void);
+#else
+void irqchip_init(void) {};
+#endif
 
 #endif
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 irqchip: Add irqchip_init dummy function

Hello.

Quoted 19 lines · Bastian Hecht

We add an empty irqchip_init dummy function for cases in which CONFIG_IRQCHIP is not used. In these cases irqchip.c is not compiled, but a funtion call may still be present in architecture code, that in runtime doesn't get hit.

E.g. this is needed in the arch/arm/mach-shmobile/intc-r8a7740.c interrupt setup code where OF use and non OF us is both handled in one file.

---
  include/linux/irqchip.h |    4 ++++
  1 file changed, 4 insertions(+)
include/linux/irqchip.h +0 -0
index e0006f1..78527ba 100644

include/linux/irqchip.h line 17

Quoted 7 lines
include/linux/irqchip.h +3 -0
@@ -11,6 +11,10 @@
  #ifndef _LINUX_IRQCHIP_H
  #define _LINUX_IRQCHIP_H
 
+#ifdef CONFIG_IRQCHIP
  void irqchip_init(void);
+#else
+void irqchip_init(void) {};

Semicolon not needed here.

include/linux/irqchip.h line 18

Quoted 1 line
include/linux/irqchip.h +1 -0
+#endif

WBR, Sergei

#2 lore raw

PATCH 1/1 irqchip: Add irqchip_init dummy function

Quoted 6 lines · Sergei Shtylyov
Quoted 6 lines
include/linux/irqchip.h +0 -0
@@ -11,6 +11,10 @@
  #ifndef _LINUX_IRQCHIP_H
  #define _LINUX_IRQCHIP_H
 
Quoted 9 lines

include/linux/irqchip.h line 17

Quoted 4 lines
include/linux/irqchip.h +3 -0
+#ifdef CONFIG_IRQCHIP
  void irqchip_init(void);
+#else
+void irqchip_init(void) {};

Semicolon not needed here.

Quoted 1 line
include/linux/irqchip.h +1 -0
+#endif

More importantly, the function should be marked as "static inline", otherwise you get a link error if this header is included in more than one place.

Arnd

#3 lore raw

PATCH 1/1 irqchip: Add irqchip_init dummy function

Hello.

Quoted 13 lines · Arnd Bergmann
Quoted 13 lines

include/linux/irqchip.h line 17

Quoted 11 lines
include/linux/irqchip.h +3 -0
@@ -11,6 +11,10 @@
   #ifndef _LINUX_IRQCHIP_H
   #define _LINUX_IRQCHIP_H
 
+#ifdef CONFIG_IRQCHIP
   void irqchip_init(void);
+#else
+void irqchip_init(void) {};

Semicolon not needed here.

Quoted 3 lines
Quoted 1 line

include/linux/irqchip.h line 18

Quoted 1 line
include/linux/irqchip.h +1 -0
+#endif

More importantly, the function should be marked as "static inline", otherwise you get a link error if this header is included in more than one place.

Right, I should have noticed that too. :-)

Quoted 1 line

Arnd

WBR, Sergei

#4 lore raw

PATCH 1/1 irqchip: Add irqchip_init dummy function

Quoted 17 lines · Sergei Shtylyov

Hello.

Quoted 13 lines · Arnd Bergmann
Quoted 13 lines

include/linux/irqchip.h line 17

Quoted 11 lines
include/linux/irqchip.h +3 -0
@@ -11,6 +11,10 @@
  #ifndef _LINUX_IRQCHIP_H
  #define _LINUX_IRQCHIP_H
 
+#ifdef CONFIG_IRQCHIP
  void irqchip_init(void);
+#else
+void irqchip_init(void) {};

Semicolon not needed here.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

include/linux/irqchip.h line 18

Quoted 1 line
include/linux/irqchip.h +1 -0
+#endif

More importantly, the function should be marked as "static inline", otherwise you get a link error if this header is included in more than one place.

Right, I should have noticed that too. :-)

Quoted 1 line

Arnd

Thanks, I will queue-up the following in the intc-external-irq branch.

From: Bastian Hecht <[email protected]>

irqchip: Add irqchip_init dummy function

We add an empty irqchip_init dummy function for cases in which CONFIG_IRQCHIP is not used. In these cases irqchip.c is not compiled, but a funtion call may still be present in architecture code, that in runtime doesn't get hit.

E.g. this is needed in the arch/arm/mach-shmobile/intc-r8a7740.c interrupt setup code where OF use and non OF us is both handled in one file.

[horms+renesas at verge.net.au: Make non-CONFIG_IRQCHIP version static inline and remove trailing ';'.]

include/linux/irqchip.h +4 -0
index e0006f1..14d7913 100644
@@ -11,6 +11,10 @@
 #ifndef _LINUX_IRQCHIP_H
 #define _LINUX_IRQCHIP_H
 
+#ifdef CONFIG_IRQCHIP
 void irqchip_init(void);
+#else
+static inline void irqchip_init(void) {}
+#endif
 
 #endif