Patchwork [05/12] irq: misc preparations for further changes

login
register
mail settings
Submitter Tejun Heo
Date June 13, 2010, 3:31 p.m.
Message ID <1276443098-20653-6-git-send-email-tj@kernel.org>
Download mbox | patch
Permalink /patch/55449/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Tejun Heo - June 13, 2010, 3:31 p.m.
* properly indent irqaction fields.

* factor out print_irq_handler()

Signed-off-by: Tejun Heo <tj@kernel.org>
---
 include/linux/interrupt.h |   20 ++++++++++----------
 kernel/irq/spurious.c     |   28 ++++++++++++++++------------
 2 files changed, 26 insertions(+), 22 deletions(-)

Patch

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 61857f1..b20bd65 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -102,16 +102,16 @@  typedef irqreturn_t (*irq_handler_t)(int, void *);
  * @thread_flags:	flags related to @thread
  */
 struct irqaction {
-	irq_handler_t handler;
-	unsigned long flags;
-	const char *name;
-	void *dev_id;
-	struct irqaction *next;
-	int irq;
-	struct proc_dir_entry *dir;
-	irq_handler_t thread_fn;
-	struct task_struct *thread;
-	unsigned long thread_flags;
+	irq_handler_t		handler;
+	unsigned long		flags;
+	const char		*name;
+	void			*dev_id;
+	struct irqaction	*next;
+	int			irq;
+	struct proc_dir_entry	*dir;
+	irq_handler_t		thread_fn;
+	struct task_struct	*thread;
+	unsigned long		thread_flags;
 };
 
 extern irqreturn_t no_action(int cpl, void *dev_id);
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
index fc18a13..0bce0e3 100644
--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -28,6 +28,21 @@  enum {
 int noirqdebug __read_mostly;
 static int irqfixup __read_mostly = IRQFIXUP_SPURIOUS;
 
+static void print_irq_handlers(struct irq_desc *desc)
+{
+	struct irqaction *action;
+
+	printk(KERN_ERR "handlers:\n");
+
+	action = desc->action;
+	while (action) {
+		printk(KERN_ERR "[<%p>]", action->handler);
+		print_symbol(" (%s)", (unsigned long)action->handler);
+		printk("\n");
+		action = action->next;
+	}
+}
+
 /*
  * Recovery handler for misrouted interrupts.
  */
@@ -126,8 +141,6 @@  static void
 __report_bad_irq(unsigned int irq, struct irq_desc *desc,
 		 irqreturn_t action_ret)
 {
-	struct irqaction *action;
-
 	if (action_ret != IRQ_HANDLED && action_ret != IRQ_NONE) {
 		printk(KERN_ERR "irq event %d: bogus return value %x\n",
 				irq, action_ret);
@@ -136,16 +149,7 @@  __report_bad_irq(unsigned int irq, struct irq_desc *desc,
 				"the \"irqpoll\" option)\n", irq);
 	}
 	dump_stack();
-	printk(KERN_ERR "handlers:\n");
-
-	action = desc->action;
-	while (action) {
-		printk(KERN_ERR "[<%p>]", action->handler);
-		print_symbol(" (%s)",
-			(unsigned long)action->handler);
-		printk("\n");
-		action = action->next;
-	}
+	print_irq_handlers(desc);
 }
 
 static void