* [PATCH] irqchip: Add irqchip_init dummy function
@ 2013-05-08 13:20 Bastian Hecht
2013-05-08 15:15 ` Sergei Shtylyov
0 siblings, 1 reply; 5+ messages in thread
From: Bastian Hecht @ 2013-05-08 13:20 UTC (permalink / raw)
To: linux-arm-kernel
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.
Signed-off-by: Bastian Hecht <hechtb+renesas@gmail.com>
---
include/linux/irqchip.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h
index e0006f1..78527ba 100644
--- a/include/linux/irqchip.h
+++ b/include/linux/irqchip.h
@@ -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
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] irqchip: Add irqchip_init dummy function
2013-05-08 13:20 [PATCH] irqchip: Add irqchip_init dummy function Bastian Hecht
@ 2013-05-08 15:15 ` Sergei Shtylyov
2013-05-08 16:33 ` Arnd Bergmann
0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2013-05-08 15:15 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 08-05-2013 17:20, Bastian Hecht wrote:
> 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.
> Signed-off-by: Bastian Hecht <hechtb+renesas@gmail.com>
> ---
> include/linux/irqchip.h | 4 ++++
> 1 file changed, 4 insertions(+)
> diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h
> index e0006f1..78527ba 100644
> --- a/include/linux/irqchip.h
> +++ b/include/linux/irqchip.h
> @@ -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.
> +#endif
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] irqchip: Add irqchip_init dummy function
2013-05-08 15:15 ` Sergei Shtylyov
@ 2013-05-08 16:33 ` Arnd Bergmann
2013-05-08 18:51 ` Sergei Shtylyov
0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2013-05-08 16:33 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 08 May 2013, Sergei Shtylyov wrote:
> > --- a/include/linux/irqchip.h
> > +++ b/include/linux/irqchip.h
> > @@ -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.
>
> > +#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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] irqchip: Add irqchip_init dummy function
2013-05-08 16:33 ` Arnd Bergmann
@ 2013-05-08 18:51 ` Sergei Shtylyov
2013-05-09 3:44 ` Simon Horman
0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2013-05-08 18:51 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 05/08/2013 08:33 PM, Arnd Bergmann wrote:
>
>>> --- a/include/linux/irqchip.h
>>> +++ b/include/linux/irqchip.h
>>> @@ -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.
>>
>>> +#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. :-)
> Arnd
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] irqchip: Add irqchip_init dummy function
2013-05-08 18:51 ` Sergei Shtylyov
@ 2013-05-09 3:44 ` Simon Horman
0 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2013-05-09 3:44 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, May 08, 2013 at 10:51:38PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 05/08/2013 08:33 PM, Arnd Bergmann wrote:
>
> >
> >>>--- a/include/linux/irqchip.h
> >>>+++ b/include/linux/irqchip.h
> >>>@@ -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.
> >>
> >>>+#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. :-)
>
> > Arnd
Thanks, I will queue-up the following in the intc-external-irq branch.
From: Bastian Hecht <hechtb@gmail.com>
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.
Signed-off-by: Bastian Hecht <hechtb+renesas@gmail.com>
[horms+renesas at verge.net.au: Make non-CONFIG_IRQCHIP version static inline
and remove trailing ';'.]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h
index e0006f1..14d7913 100644
--- a/include/linux/irqchip.h
+++ b/include/linux/irqchip.h
@@ -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
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-05-09 3:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-08 13:20 [PATCH] irqchip: Add irqchip_init dummy function Bastian Hecht
2013-05-08 15:15 ` Sergei Shtylyov
2013-05-08 16:33 ` Arnd Bergmann
2013-05-08 18:51 ` Sergei Shtylyov
2013-05-09 3:44 ` Simon Horman
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).