diff mbox

irqchip: Add irqchip_init dummy function

Message ID 1368019204-24448-1-git-send-email-hechtb+renesas@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bastian Hecht May 8, 2013, 1:20 p.m. UTC
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(+)

Comments

Sergei Shtylyov May 8, 2013, 3:15 p.m. UTC | #1
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
Arnd Bergmann May 8, 2013, 4:33 p.m. UTC | #2
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
Sergei Shtylyov May 8, 2013, 6:51 p.m. UTC | #3
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
diff mbox

Patch

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