Skip to contentSkip to conversation

xen: cleanup unused request{_dt, }_irq() parameter

PATCH In review Andrew Cooper 3 participants 6 messages Aug 6, 2013 – Aug 7, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: cleanup unused request{_dt, }_irq() parameter

The irqflags parameter appears to be an unused vestigial parameter right from the integration of the IOMMU code in 2007. The parameter is 0 at all callsites and never used.

CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>
CC Tim Deegan <[email protected]>
CC Ian Campbell <[email protected]>
CC Stefano Stabellini <[email protected]>

---

The arm tree picked this up when copying from x86. I have checked the x86 compilation but don't have an arm compiler to hand. git grep indicates that I have found all callsites.

---
 xen/arch/arm/gic.c                       |    2 +-
 xen/arch/arm/irq.c                       |    2 +-
 xen/arch/arm/time.c                      |    6 +++---
 xen/arch/x86/hpet.c                      |    2 +-
 xen/arch/x86/irq.c                       |    2 +-
 xen/drivers/passthrough/amd/iommu_init.c |    2 +-
 xen/drivers/passthrough/vtd/iommu.c      |    2 +-
 xen/include/asm-arm/irq.h                |    3 +--
 xen/include/xen/irq.h                    |    2 +-
 9 files changed, 11 insertions(+), 12 deletions(-)
xen/arch/arm/gic.c +1 -1
index ccce565..7c24811 100644
@@ -893,7 +893,7 @@ void gic_dump_info(struct vcpu *v)
 void __cpuinit init_maintenance_interrupt(void)
 {
     request_dt_irq(&gic.maintenance, maintenance_interrupt,
-                   0, "irq-maintenance", NULL);
+                   "irq-maintenance", NULL);
 }
 
 /*
xen/arch/arm/irq.c +1 -1
index 2fe4296..3e326b0 100644
@@ -95,7 +95,7 @@ void __cpuinit init_secondary_IRQ(void)
 
 int __init request_dt_irq(const struct dt_irq *irq,
         void (*handler)(int, void *, struct cpu_user_regs *),
-        unsigned long irqflags, const char *devname, void *dev_id)
+        const char *devname, void *dev_id)
 {
     struct irqaction *action;
     int retval;
xen/arch/arm/time.c +3 -3
index 4ed7882..b5864ef 100644
@@ -238,11 +238,11 @@ void __cpuinit init_timer_interrupt(void)
     WRITE_SYSREG32(0, CNTHP_CTL_EL2);   /* Hypervisor's timer disabled */
     isb();
 
-    request_dt_irq(&timer_irq[TIMER_HYP_PPI], timer_interrupt, 0,
+    request_dt_irq(&timer_irq[TIMER_HYP_PPI], timer_interrupt,
                    "hyptimer", NULL);
-    request_dt_irq(&timer_irq[TIMER_VIRT_PPI], vtimer_interrupt, 0,
+    request_dt_irq(&timer_irq[TIMER_VIRT_PPI], vtimer_interrupt,
                    "virtimer", NULL);
-    request_dt_irq(&timer_irq[TIMER_PHYS_NONSECURE_PPI], timer_interrupt, 0,
+    request_dt_irq(&timer_irq[TIMER_PHYS_NONSECURE_PPI], timer_interrupt,
                    "phytimer", NULL);
 }
 
xen/arch/x86/hpet.c +1 -1
index 946d133..7e0d332 100644
@@ -355,7 +355,7 @@ static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));
 
     desc->handler = &hpet_msi_type;
-    ret = request_irq(ch->msi.irq, hpet_interrupt_handler, 0, "HPET", ch);
+    ret = request_irq(ch->msi.irq, hpet_interrupt_handler, "HPET", ch);
     if ( ret >= 0 )
         ret = __hpet_setup_msi_irq(desc);
     if ( ret < 0 )
xen/arch/x86/irq.c +1 -1
index a4da786..97292fd 100644
@@ -951,7 +951,7 @@ __initcall(irq_ratelimit_init);
 
 int __init request_irq(unsigned int irq,
         void (*handler)(int, void *, struct cpu_user_regs *),
-        unsigned long irqflags, const char * devname, void *dev_id)
+        const char * devname, void *dev_id)
 {
     struct irqaction * action;
     int retval;
xen/drivers/passthrough/amd/iommu_init.c +1 -1
index c19b51d..b431d16 100644
@@ -814,7 +814,7 @@ static bool_t __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
         handler = &iommu_msi_type;
     ret = __setup_msi_irq(irq_to_desc(irq), &iommu->msi, handler);
     if ( !ret )
-        ret = request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", iommu);
+        ret = request_irq(irq, iommu_interrupt_handler, "amd_iommu", iommu);
     if ( ret )
     {
         destroy_irq(irq);
xen/drivers/passthrough/vtd/iommu.c +1 -1
index 76f7b8e..ddf713b 100644
@@ -1098,7 +1098,7 @@ static int __init iommu_set_interrupt(struct acpi_drhd_unit *drhd)
 
     desc = irq_to_desc(irq);
     desc->handler = &dma_msi_type;
-    ret = request_irq(irq, iommu_page_fault, 0, "dmar", iommu);
+    ret = request_irq(irq, iommu_page_fault, "dmar", iommu);
     if ( ret )
     {
         desc->handler = &no_irq_type;
xen/include/asm-arm/irq.h +1 -2
index 80ff68d..7c20703 100644
@@ -42,8 +42,7 @@ void init_secondary_IRQ(void);
 
 int __init request_dt_irq(const struct dt_irq *irq,
                           void (*handler)(int, void *, struct cpu_user_regs *),
-                          unsigned long irqflags, const char *devname,
-                          void *dev_id);
+                          const char *devname, void *dev_id);
 int __init setup_dt_irq(const struct dt_irq *irq, struct irqaction *new);
 
 #endif /* _ASM_HW_IRQ_H */
xen/include/xen/irq.h +1 -1
index eaf1a84..f2e6215 100644
@@ -93,7 +93,7 @@ extern int setup_irq(unsigned int irq, struct irqaction *);
 extern void release_irq(unsigned int irq);
 extern int request_irq(unsigned int irq,
                void (*handler)(int, void *, struct cpu_user_regs *),
-               unsigned long irqflags, const char * devname, void *dev_id);
+               const char * devname, void *dev_id);
 
 extern hw_irq_controller no_irq_type;
 extern void no_action(int cpl, void *dev_id, struct cpu_user_regs *regs);
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Andrew Cooper

The irqflags parameter appears to be an unused vestigial parameter right from the integration of the IOMMU code in 2007. The parameter is 0 at all callsites and never used.

CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>
CC Tim Deegan <[email protected]>

I'll assume that one of the core/generic/x86 committers will take this unless one of them tells me otherwise.

Quoted 143 lines
CC Stefano Stabellini <[email protected]>

---

The arm tree picked this up when copying from x86. I have checked the x86 compilation but don't have an arm compiler to hand. git grep indicates that I have found all callsites.

---
 xen/arch/arm/gic.c                       |    2 +-
 xen/arch/arm/irq.c                       |    2 +-
 xen/arch/arm/time.c                      |    6 +++---
 xen/arch/x86/hpet.c                      |    2 +-
 xen/arch/x86/irq.c                       |    2 +-
 xen/drivers/passthrough/amd/iommu_init.c |    2 +-
 xen/drivers/passthrough/vtd/iommu.c      |    2 +-
 xen/include/asm-arm/irq.h                |    3 +--
 xen/include/xen/irq.h                    |    2 +-
 9 files changed, 11 insertions(+), 12 deletions(-)
xen/arch/arm/gic.c +1 -1
index ccce565..7c24811 100644
@@ -893,7 +893,7 @@ void gic_dump_info(struct vcpu *v)
 void __cpuinit init_maintenance_interrupt(void)
 {
     request_dt_irq(&gic.maintenance, maintenance_interrupt,
-                   0, "irq-maintenance", NULL);
+                   "irq-maintenance", NULL);
 }
 
 /*
xen/arch/arm/irq.c +1 -1
index 2fe4296..3e326b0 100644
@@ -95,7 +95,7 @@ void __cpuinit init_secondary_IRQ(void)
 
 int __init request_dt_irq(const struct dt_irq *irq,
         void (*handler)(int, void *, struct cpu_user_regs *),
-        unsigned long irqflags, const char *devname, void *dev_id)
+        const char *devname, void *dev_id)
 {
     struct irqaction *action;
     int retval;
xen/arch/arm/time.c +3 -3
index 4ed7882..b5864ef 100644
@@ -238,11 +238,11 @@ void __cpuinit init_timer_interrupt(void)
     WRITE_SYSREG32(0, CNTHP_CTL_EL2);   /* Hypervisor's timer disabled */
     isb();
 
-    request_dt_irq(&timer_irq[TIMER_HYP_PPI], timer_interrupt, 0,
+    request_dt_irq(&timer_irq[TIMER_HYP_PPI], timer_interrupt,
                    "hyptimer", NULL);
-    request_dt_irq(&timer_irq[TIMER_VIRT_PPI], vtimer_interrupt, 0,
+    request_dt_irq(&timer_irq[TIMER_VIRT_PPI], vtimer_interrupt,
                    "virtimer", NULL);
-    request_dt_irq(&timer_irq[TIMER_PHYS_NONSECURE_PPI], timer_interrupt, 0,
+    request_dt_irq(&timer_irq[TIMER_PHYS_NONSECURE_PPI], timer_interrupt,
                    "phytimer", NULL);
 }
 
xen/arch/x86/hpet.c +1 -1
index 946d133..7e0d332 100644
@@ -355,7 +355,7 @@ static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));
 
     desc->handler = &hpet_msi_type;
-    ret = request_irq(ch->msi.irq, hpet_interrupt_handler, 0, "HPET", ch);
+    ret = request_irq(ch->msi.irq, hpet_interrupt_handler, "HPET", ch);
     if ( ret >= 0 )
         ret = __hpet_setup_msi_irq(desc);
     if ( ret < 0 )
xen/arch/x86/irq.c +1 -1
index a4da786..97292fd 100644
@@ -951,7 +951,7 @@ __initcall(irq_ratelimit_init);
 
 int __init request_irq(unsigned int irq,
         void (*handler)(int, void *, struct cpu_user_regs *),
-        unsigned long irqflags, const char * devname, void *dev_id)
+        const char * devname, void *dev_id)
 {
     struct irqaction * action;
     int retval;
xen/drivers/passthrough/amd/iommu_init.c +1 -1
index c19b51d..b431d16 100644
@@ -814,7 +814,7 @@ static bool_t __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
         handler = &iommu_msi_type;
     ret = __setup_msi_irq(irq_to_desc(irq), &iommu->msi, handler);
     if ( !ret )
-        ret = request_irq(irq, iommu_interrupt_handler, 0, "amd_iommu", iommu);
+        ret = request_irq(irq, iommu_interrupt_handler, "amd_iommu", iommu);
     if ( ret )
     {
         destroy_irq(irq);
xen/drivers/passthrough/vtd/iommu.c +1 -1
index 76f7b8e..ddf713b 100644
@@ -1098,7 +1098,7 @@ static int __init iommu_set_interrupt(struct acpi_drhd_unit *drhd)
 
     desc = irq_to_desc(irq);
     desc->handler = &dma_msi_type;
-    ret = request_irq(irq, iommu_page_fault, 0, "dmar", iommu);
+    ret = request_irq(irq, iommu_page_fault, "dmar", iommu);
     if ( ret )
     {
         desc->handler = &no_irq_type;
xen/include/asm-arm/irq.h +1 -2
index 80ff68d..7c20703 100644
@@ -42,8 +42,7 @@ void init_secondary_IRQ(void);
 
 int __init request_dt_irq(const struct dt_irq *irq,
                           void (*handler)(int, void *, struct cpu_user_regs *),
-                          unsigned long irqflags, const char *devname,
-                          void *dev_id);
+                          const char *devname, void *dev_id);
 int __init setup_dt_irq(const struct dt_irq *irq, struct irqaction *new);
 
 #endif /* _ASM_HW_IRQ_H */
xen/include/xen/irq.h +1 -1
index eaf1a84..f2e6215 100644
@@ -93,7 +93,7 @@ extern int setup_irq(unsigned int irq, struct irqaction *);
 extern void release_irq(unsigned int irq);
 extern int request_irq(unsigned int irq,
                void (*handler)(int, void *, struct cpu_user_regs *),
-               unsigned long irqflags, const char * devname, void *dev_id);
+               const char * devname, void *dev_id);
 
 extern hw_irq_controller no_irq_type;
 extern void no_action(int cpl, void *dev_id, struct cpu_user_regs *regs);
Reviewed-by on v1 1/1
#2 lore raw
In reply to Andrew Cooper
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Andrew Cooper

The irqflags parameter appears to be an unused vestigial parameter right from the integration of the IOMMU code in 2007. The parameter is 0 at all callsites and never used.

If I were to commit it - with the appropriate acks - I'd also cleanup the white space damage left in place:

xen/arch/x86/irq.c __initcall(irq_ratelimit_init); · line 954

Quoted 8 lines
xen/arch/x86/irq.c +1 -1
@@ -951,7 +951,7 @@ __initcall(irq_ratelimit_init);
 
 int __init request_irq(unsigned int irq,
         void (*handler)(int, void *, struct cpu_user_regs *),
-        unsigned long irqflags, const char * devname, void *dev_id)
+        const char * devname, void *dev_id)

Here ...

xen/include/xen/irq.h extern int setup_irq(unsigned int irq, struct irqaction *); · line 96

Quoted 8 lines
xen/include/xen/irq.h +1 -1
@@ -93,7 +93,7 @@ extern int setup_irq(unsigned int irq, struct irqaction *);
 extern void release_irq(unsigned int irq);
 extern int request_irq(unsigned int irq,
                void (*handler)(int, void *, struct cpu_user_regs *),
-               unsigned long irqflags, const char * devname, void *dev_id);
+               const char * devname, void *dev_id);

... and here.

I'd encourage you to in the future do such obvious cleanup on code you touch anyway.

Jan

#3 lore raw
Quoted 31 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Andrew Cooper

The irqflags parameter appears to be an unused vestigial parameter right from the integration of the IOMMU code in 2007. The parameter is 0 at all callsites and never used.

If I were to commit it - with the appropriate acks - I'd also cleanup the white space damage left in place:

xen/arch/x86/irq.c __initcall(irq_ratelimit_init); · line 954

Quoted 8 lines
xen/arch/x86/irq.c +1 -1
@@ -951,7 +951,7 @@ __initcall(irq_ratelimit_init);
 
 int __init request_irq(unsigned int irq,
         void (*handler)(int, void *, struct cpu_user_regs *),
-        unsigned long irqflags, const char * devname, void *dev_id)
+        const char * devname, void *dev_id)

Here ...

xen/include/xen/irq.h extern int setup_irq(unsigned int irq, struct irqaction *); · line 96

Quoted 8 lines
xen/include/xen/irq.h +1 -1
@@ -93,7 +93,7 @@ extern int setup_irq(unsigned int irq, struct irqaction *);
 extern void release_irq(unsigned int irq);
 extern int request_irq(unsigned int irq,
                void (*handler)(int, void *, struct cpu_user_regs *),
-               unsigned long irqflags, const char * devname, void *dev_id);
+               const char * devname, void *dev_id);

... and here.

Quoted 5 lines

I'd encourage you to in the future do such obvious cleanup on code you touch anyway.

Jan

Certainly (I tend to, but it slipped my mind this time) - I shall submit v2

~Andrew

#4 lore raw
Quoted 34 lines
Quoted 1 line
Quoted 1 line · Andrew Cooper
Quoted 2 lines · Jan Beulich
Quoted 2 lines
Quoted 1 line
Quoted 1 line · Andrew Cooper

The irqflags parameter appears to be an unused vestigial parameter right

from

Quoted 29 lines
Quoted 4 lines

the integration of the IOMMU code in 2007. The parameter is 0 at all callsites and never used.

If I were to commit it - with the appropriate acks - I'd also cleanup the white space damage left in place:

xen/arch/x86/irq.c __initcall(irq_ratelimit_init); · line 954

Quoted 8 lines
xen/arch/x86/irq.c +1 -1
@@ -951,7 +951,7 @@ __initcall(irq_ratelimit_init);
 
 int __init request_irq(unsigned int irq,
         void (*handler)(int, void *, struct cpu_user_regs *),
-        unsigned long irqflags, const char * devname, void *dev_id)
+        const char * devname, void *dev_id)

Here ...

xen/include/xen/irq.h extern int setup_irq(unsigned int irq, struct irqaction *); · line 96

Quoted 8 lines
xen/include/xen/irq.h +1 -1
@@ -93,7 +93,7 @@ extern int setup_irq(unsigned int irq, struct irqaction *);
 extern void release_irq(unsigned int irq);
 extern int request_irq(unsigned int irq,
                void (*handler)(int, void *, struct cpu_user_regs *),
-               unsigned long irqflags, const char * devname, void *dev_id);
+               const char * devname, void *dev_id);

... and here.

Quoted 7 lines
Quoted 5 lines

I'd encourage you to in the future do such obvious cleanup on code you touch anyway.

Jan

Certainly (I tend to, but it slipped my mind this time) - I shall submit v2

No need to do so - as said, if I'm going to be the one to apply this (likely), I'll do that cleanup as I go.

Jan

#5 lore raw
Quoted 37 lines · Jan Beulich
Quoted 37 lines
Quoted 1 line
Quoted 1 line · Andrew Cooper
Quoted 2 lines · Jan Beulich
Quoted 2 lines
Quoted 1 line
Quoted 1 line · Andrew Cooper

The irqflags parameter appears to be an unused vestigial parameter right

from

Quoted 32 lines
Quoted 4 lines

the integration of the IOMMU code in 2007. The parameter is 0 at all callsites and never used.

If I were to commit it - with the appropriate acks - I'd also cleanup the white space damage left in place:

xen/arch/x86/irq.c __initcall(irq_ratelimit_init); · line 954

Quoted 8 lines
xen/arch/x86/irq.c +1 -1
@@ -951,7 +951,7 @@ __initcall(irq_ratelimit_init);
 
 int __init request_irq(unsigned int irq,
         void (*handler)(int, void *, struct cpu_user_regs *),
-        unsigned long irqflags, const char * devname, void *dev_id)
+        const char * devname, void *dev_id)

Here ...

xen/include/xen/irq.h extern int setup_irq(unsigned int irq, struct irqaction *); · line 96

Quoted 8 lines
xen/include/xen/irq.h +1 -1
@@ -93,7 +93,7 @@ extern int setup_irq(unsigned int irq, struct irqaction *);
 extern void release_irq(unsigned int irq);
 extern int request_irq(unsigned int irq,
                void (*handler)(int, void *, struct cpu_user_regs *),
-               unsigned long irqflags, const char * devname, void *dev_id);
+               const char * devname, void *dev_id);

... and here.

I'd encourage you to in the future do such obvious cleanup on code you touch anyway.

Quoted 8 lines
Quoted 3 lines
Quoted 2 lines

Jan

Certainly (I tend to, but it slipped my mind this time) - I shall submit v2

No need to do so - as said, if I'm going to be the one to apply this (likely), I'll do that cleanup as I go.

Jan

Ok - thanks.

~Andrew