summaryrefslogtreecommitdiffstats
path: root/kernel/irq
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-09-14 04:42:37 -0400
committerThomas Gleixner <tglx@linutronix.de>2015-09-16 09:47:51 -0400
commitbd0b9ac405e1794d72533c3d487aa65b6b955a0c (patch)
tree784e3d1f86a93bc32e0f2635d19399e15146a8e1 /kernel/irq
parentb237721c5d95082a803c0be686f56d2dd1de995b (diff)
genirq: Remove irq argument from irq flow handlers
Most interrupt flow handlers do not use the irq argument. Those few which use it can retrieve the irq number from the irq descriptor. Remove the argument. Search and replace was done with coccinelle and some extra helper scripts around it. Thanks to Julia for her help! Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Julia Lawall <Julia.Lawall@lip6.fr> Cc: Jiang Liu <jiang.liu@linux.intel.com>
Diffstat (limited to 'kernel/irq')
-rw-r--r--kernel/irq/chip.c27
-rw-r--r--kernel/irq/handle.c4
-rw-r--r--kernel/irq/irqdesc.c2
-rw-r--r--kernel/irq/resend.c2
4 files changed, 13 insertions, 22 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 8c55d545558f..e28169dd1c36 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -372,7 +372,6 @@ static bool irq_may_run(struct irq_desc *desc)
372 372
373/** 373/**
374 * handle_simple_irq - Simple and software-decoded IRQs. 374 * handle_simple_irq - Simple and software-decoded IRQs.
375 * @irq: the interrupt number
376 * @desc: the interrupt description structure for this irq 375 * @desc: the interrupt description structure for this irq
377 * 376 *
378 * Simple interrupts are either sent from a demultiplexing interrupt 377 * Simple interrupts are either sent from a demultiplexing interrupt
@@ -382,8 +381,7 @@ static bool irq_may_run(struct irq_desc *desc)
382 * Note: The caller is expected to handle the ack, clear, mask and 381 * Note: The caller is expected to handle the ack, clear, mask and
383 * unmask issues if necessary. 382 * unmask issues if necessary.
384 */ 383 */
385void 384void handle_simple_irq(struct irq_desc *desc)
386handle_simple_irq(unsigned int irq, struct irq_desc *desc)
387{ 385{
388 raw_spin_lock(&desc->lock); 386 raw_spin_lock(&desc->lock);
389 387
@@ -425,7 +423,6 @@ static void cond_unmask_irq(struct irq_desc *desc)
425 423
426/** 424/**
427 * handle_level_irq - Level type irq handler 425 * handle_level_irq - Level type irq handler
428 * @irq: the interrupt number
429 * @desc: the interrupt description structure for this irq 426 * @desc: the interrupt description structure for this irq
430 * 427 *
431 * Level type interrupts are active as long as the hardware line has 428 * Level type interrupts are active as long as the hardware line has
@@ -433,8 +430,7 @@ static void cond_unmask_irq(struct irq_desc *desc)
433 * it after the associated handler has acknowledged the device, so the 430 * it after the associated handler has acknowledged the device, so the
434 * interrupt line is back to inactive. 431 * interrupt line is back to inactive.
435 */ 432 */
436void 433void handle_level_irq(struct irq_desc *desc)
437handle_level_irq(unsigned int irq, struct irq_desc *desc)
438{ 434{
439 raw_spin_lock(&desc->lock); 435 raw_spin_lock(&desc->lock);
440 mask_ack_irq(desc); 436 mask_ack_irq(desc);
@@ -496,7 +492,6 @@ static void cond_unmask_eoi_irq(struct irq_desc *desc, struct irq_chip *chip)
496 492
497/** 493/**
498 * handle_fasteoi_irq - irq handler for transparent controllers 494 * handle_fasteoi_irq - irq handler for transparent controllers
499 * @irq: the interrupt number
500 * @desc: the interrupt description structure for this irq 495 * @desc: the interrupt description structure for this irq
501 * 496 *
502 * Only a single callback will be issued to the chip: an ->eoi() 497 * Only a single callback will be issued to the chip: an ->eoi()
@@ -504,8 +499,7 @@ static void cond_unmask_eoi_irq(struct irq_desc *desc, struct irq_chip *chip)
504 * for modern forms of interrupt handlers, which handle the flow 499 * for modern forms of interrupt handlers, which handle the flow
505 * details in hardware, transparently. 500 * details in hardware, transparently.
506 */ 501 */
507void 502void handle_fasteoi_irq(struct irq_desc *desc)
508handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
509{ 503{
510 struct irq_chip *chip = desc->irq_data.chip; 504 struct irq_chip *chip = desc->irq_data.chip;
511 505
@@ -546,7 +540,6 @@ EXPORT_SYMBOL_GPL(handle_fasteoi_irq);
546 540
547/** 541/**
548 * handle_edge_irq - edge type IRQ handler 542 * handle_edge_irq - edge type IRQ handler
549 * @irq: the interrupt number
550 * @desc: the interrupt description structure for this irq 543 * @desc: the interrupt description structure for this irq
551 * 544 *
552 * Interrupt occures on the falling and/or rising edge of a hardware 545 * Interrupt occures on the falling and/or rising edge of a hardware
@@ -560,8 +553,7 @@ EXPORT_SYMBOL_GPL(handle_fasteoi_irq);
560 * the handler was running. If all pending interrupts are handled, the 553 * the handler was running. If all pending interrupts are handled, the
561 * loop is left. 554 * loop is left.
562 */ 555 */
563void 556void handle_edge_irq(struct irq_desc *desc)
564handle_edge_irq(unsigned int irq, struct irq_desc *desc)
565{ 557{
566 raw_spin_lock(&desc->lock); 558 raw_spin_lock(&desc->lock);
567 559
@@ -618,13 +610,12 @@ EXPORT_SYMBOL(handle_edge_irq);
618#ifdef CONFIG_IRQ_EDGE_EOI_HANDLER 610#ifdef CONFIG_IRQ_EDGE_EOI_HANDLER
619/** 611/**
620 * handle_edge_eoi_irq - edge eoi type IRQ handler 612 * handle_edge_eoi_irq - edge eoi type IRQ handler
621 * @irq: the interrupt number
622 * @desc: the interrupt description structure for this irq 613 * @desc: the interrupt description structure for this irq
623 * 614 *
624 * Similar as the above handle_edge_irq, but using eoi and w/o the 615 * Similar as the above handle_edge_irq, but using eoi and w/o the
625 * mask/unmask logic. 616 * mask/unmask logic.
626 */ 617 */
627void handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc) 618void handle_edge_eoi_irq(struct irq_desc *desc)
628{ 619{
629 struct irq_chip *chip = irq_desc_get_chip(desc); 620 struct irq_chip *chip = irq_desc_get_chip(desc);
630 621
@@ -665,13 +656,11 @@ out_eoi:
665 656
666/** 657/**
667 * handle_percpu_irq - Per CPU local irq handler 658 * handle_percpu_irq - Per CPU local irq handler
668 * @irq: the interrupt number
669 * @desc: the interrupt description structure for this irq 659 * @desc: the interrupt description structure for this irq
670 * 660 *
671 * Per CPU interrupts on SMP machines without locking requirements 661 * Per CPU interrupts on SMP machines without locking requirements
672 */ 662 */
673void 663void handle_percpu_irq(struct irq_desc *desc)
674handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
675{ 664{
676 struct irq_chip *chip = irq_desc_get_chip(desc); 665 struct irq_chip *chip = irq_desc_get_chip(desc);
677 666
@@ -688,7 +677,6 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
688 677
689/** 678/**
690 * handle_percpu_devid_irq - Per CPU local irq handler with per cpu dev ids 679 * handle_percpu_devid_irq - Per CPU local irq handler with per cpu dev ids
691 * @irq: the interrupt number
692 * @desc: the interrupt description structure for this irq 680 * @desc: the interrupt description structure for this irq
693 * 681 *
694 * Per CPU interrupts on SMP machines without locking requirements. Same as 682 * Per CPU interrupts on SMP machines without locking requirements. Same as
@@ -698,11 +686,12 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
698 * contain the real device id for the cpu on which this handler is 686 * contain the real device id for the cpu on which this handler is
699 * called 687 * called
700 */ 688 */
701void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc) 689void handle_percpu_devid_irq(struct irq_desc *desc)
702{ 690{
703 struct irq_chip *chip = irq_desc_get_chip(desc); 691 struct irq_chip *chip = irq_desc_get_chip(desc);
704 struct irqaction *action = desc->action; 692 struct irqaction *action = desc->action;
705 void *dev_id = raw_cpu_ptr(action->percpu_dev_id); 693 void *dev_id = raw_cpu_ptr(action->percpu_dev_id);
694 unsigned int irq = irq_desc_get_irq(desc);
706 irqreturn_t res; 695 irqreturn_t res;
707 696
708 kstat_incr_irqs_this_cpu(desc); 697 kstat_incr_irqs_this_cpu(desc);
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
index b6eeea8a80c5..de41a68fc038 100644
--- a/kernel/irq/handle.c
+++ b/kernel/irq/handle.c
@@ -27,8 +27,10 @@
27 * 27 *
28 * Handles spurious and unhandled IRQ's. It also prints a debugmessage. 28 * Handles spurious and unhandled IRQ's. It also prints a debugmessage.
29 */ 29 */
30void handle_bad_irq(unsigned int irq, struct irq_desc *desc) 30void handle_bad_irq(struct irq_desc *desc)
31{ 31{
32 unsigned int irq = irq_desc_get_irq(desc);
33
32 print_irq_desc(irq, desc); 34 print_irq_desc(irq, desc);
33 kstat_incr_irqs_this_cpu(desc); 35 kstat_incr_irqs_this_cpu(desc);
34 ack_bad_irq(irq); 36 ack_bad_irq(irq);
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
index 596669436f7a..239e2ae2c947 100644
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -347,7 +347,7 @@ int generic_handle_irq(unsigned int irq)
347 347
348 if (!desc) 348 if (!desc)
349 return -EINVAL; 349 return -EINVAL;
350 generic_handle_irq_desc(irq, desc); 350 generic_handle_irq_desc(desc);
351 return 0; 351 return 0;
352} 352}
353EXPORT_SYMBOL_GPL(generic_handle_irq); 353EXPORT_SYMBOL_GPL(generic_handle_irq);
diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c
index dd95f44f99b2..b86886beee4f 100644
--- a/kernel/irq/resend.c
+++ b/kernel/irq/resend.c
@@ -38,7 +38,7 @@ static void resend_irqs(unsigned long arg)
38 clear_bit(irq, irqs_resend); 38 clear_bit(irq, irqs_resend);
39 desc = irq_to_desc(irq); 39 desc = irq_to_desc(irq);
40 local_irq_disable(); 40 local_irq_disable();
41 desc->handle_irq(irq, desc); 41 desc->handle_irq(desc);
42 local_irq_enable(); 42 local_irq_enable();
43 } 43 }
44} 44}