From: Christian Borntraeger <borntraeger@de.ibm.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [Patch/RFC]: check CONFIG_GENERIC_HARDIRQS for request/free_irq in interrupt.h
Date: Thu, 29 May 2008 17:41:13 +0200 [thread overview]
Message-ID: <200805291741.13956.borntraeger@de.ibm.com> (raw)
I currently try to evaluate virtio_console for kvm on s390 and got
the following problem:
virtio_console uses hvc_alloc with irq=0. That means, register_irq
and free_irq are never called by hvc_console.c, but the linker will
still complain about unknown references to free_irq and request_irq.
As the whole kernel/irq folder depends on CONFIG_GENERIC_HARDIRQS
it seems consistent to declare all functions from kernel/irq only if
CONFIG_GENERIC_HARDIRQS is set. Otherwise we can use empty functions.
This patch does that for register_irq and free_irq.
Comments?
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
CC: Ingo Molnar <mingo@elte.hu>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Martin Schwidefsky <schwidefsky@de.ibm.com>
---
include/linux/interrupt.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
Index: linux-2.6/include/linux/interrupt.h
===================================================================
--- linux-2.6.orig/include/linux/interrupt.h
+++ linux-2.6/include/linux/interrupt.h
@@ -69,9 +69,22 @@ struct irqaction {
};
extern irqreturn_t no_action(int cpl, void *dev_id);
+
+#ifdef CONFIG_GENERIC_HARDIRQS
extern int __must_check request_irq(unsigned int, irq_handler_t handler,
unsigned long, const char *, void *);
extern void free_irq(unsigned int, void *);
+#else
+static inline int request_irq(unsigned int irq, irq_handler_t handler,
+ unsigned long irqflags, const char *devname, void *dev_id)
+{
+ return -EINVAL;
+}
+
+static inline void free_irq(unsigned int irq, void *dev_id)
+{
+}
+#endif
struct device;
next reply other threads:[~2008-05-29 15:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-29 15:41 Christian Borntraeger [this message]
2008-05-29 17:04 ` [Patch/RFC]: check CONFIG_GENERIC_HARDIRQS for request/free_irq in interrupt.h Martin Schwidefsky
2008-05-29 18:32 ` Christian Borntraeger
2008-05-30 3:36 ` Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200805291741.13956.borntraeger@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=schwidefsky@de.ibm.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox