Skip to contentSkip to conversation

Optimize irq flow handler

RFC In review Jiang Liu 11 participants 72 messages May 20, 2015 – Jun 24, 2015 Page 2 of 2

Subsystems (72)
lore
Share & tools
lore
Acked-by on v1 20/25
#60 lore raw

Re: [RFC v1 20/25] genirq: Kill the first parameter 'irq' of irq_flow_handler_t

In reply to Jiang Liu
Quoted 5 lines · Jiang Liu

Now most IRQ flow handlers make no use of the first parameter 'irq'. And for those who do make use of 'irq', we could easily get the irq number through irq_desc->irq_data->irq. So kill the first parameter 'irq' of irq_flow_handler_t.

Quoted 8 lines

To ease review, I have split the changes into several parts, though they should be merge as one to support bisecting.

---
 arch/alpha/kernel/irq.c             |    2 +-
 arch/avr32/mach-at32ap/extint.c     |    2 +-
 arch/avr32/mach-at32ap/pio.c        |    2 +-

For the AVR32 related bits

Quoted 10 lines
 arch/blackfin/kernel/ipipe.c        |    4 ++--
 arch/c6x/platforms/megamod-pic.c    |    3 ++-
 arch/sparc/kernel/leon_kernel.c     |    2 +-
 arch/sparc/kernel/leon_pci_grpci1.c |    2 +-
 arch/sparc/kernel/leon_pci_grpci2.c |    2 +-
 arch/tile/kernel/pci_gx.c           |    4 ++--
 arch/unicore32/kernel/irq.c         |    3 ++-
 arch/x86/kernel/irq_64.c            |    2 +-
 arch/x86/lguest/boot.c              |    2 +-
 12 files changed, 16 insertions(+), 14 deletions(-)

<snipp diff>

Signature · 1 line
HcE
author
#61 lore raw

RFC 21/25 genirq: Kill the first parameter 'irq' of irq_flow_handler_t

In reply to Jiang Liu

Now most IRQ flow handlers make no use of the first parameter 'irq'. And for those who do make use of 'irq', we could easily get the irq number through irq_desc->irq_data->irq. So kill the first parameter 'irq' of irq_flow_handler_t.

To ease review, I have split the changes into several parts, though they should be merge as one to support bisecting.

---
 drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c     |    2 +-
 drivers/pinctrl/intel/pinctrl-baytrail.c      |    2 +-
 drivers/pinctrl/intel/pinctrl-cherryview.c    |    2 +-
 drivers/pinctrl/intel/pinctrl-intel.c         |    2 +-
 drivers/pinctrl/mediatek/pinctrl-mtk-common.c |    2 +-
 drivers/pinctrl/nomadik/pinctrl-nomadik.c     |    4 ++--
 drivers/pinctrl/pinctrl-amd.c                 |    5 +++--
 drivers/pinctrl/pinctrl-at91.c                |    2 +-
 drivers/pinctrl/pinctrl-coh901.c              |    3 ++-
 drivers/pinctrl/pinctrl-rockchip.c            |    3 ++-
 drivers/pinctrl/pinctrl-single.c              |    2 +-
 drivers/pinctrl/pinctrl-st.c                  |    4 ++--
 drivers/pinctrl/qcom/pinctrl-msm.c            |    4 ++--
 drivers/pinctrl/samsung/pinctrl-exynos.c      |    4 ++--
 drivers/pinctrl/samsung/pinctrl-s3c24xx.c     |    8 ++++----
 drivers/pinctrl/samsung/pinctrl-s3c64xx.c     |   10 +++++-----
 drivers/pinctrl/sirf/pinctrl-sirf.c           |    5 +++--
 drivers/pinctrl/spear/pinctrl-plgpio.c        |    2 +-
 drivers/pinctrl/sunxi/pinctrl-sunxi.c         |    3 ++-
 19 files changed, 37 insertions(+), 32 deletions(-)
drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c +1 -1
index 4ad5c1a996e3..df940687524f 100644
@@ -143,7 +143,7 @@ static inline bool cygnus_get_bit(struct cygnus_gpio *chip, unsigned int reg,
 	return !!(readl(chip->base + offset) & BIT(shift));
 }
 
-static void cygnus_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void cygnus_gpio_irq_handler(struct irq_desc *desc)
 {
 	struct gpio_chip *gc = irq_desc_get_handler_data(desc);
 	struct cygnus_gpio *chip = to_cygnus_gpio(gc);
drivers/pinctrl/intel/pinctrl-baytrail.c +1 -1
index 2062c224e32f..94870cedb0ad 100644
@@ -421,7 +421,7 @@ static void byt_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
 	spin_unlock_irqrestore(&vg->lock, flags);
 }
 
-static void byt_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void byt_gpio_irq_handler(struct irq_desc *desc)
 {
 	struct irq_data *data = irq_desc_get_irq_data(desc);
 	struct byt_gpio *vg = to_byt_gpio(irq_desc_get_handler_data(desc));
drivers/pinctrl/intel/pinctrl-cherryview.c +1 -1
index 878e798bcb56..cfdc5f1c9cd6 100644
@@ -1364,7 +1364,7 @@ static struct irq_chip chv_gpio_irqchip = {
 	.flags = IRQCHIP_SKIP_SET_WAKE,
 };
 
-static void chv_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void chv_gpio_irq_handler(struct irq_desc *desc)
 {
 	struct gpio_chip *gc = irq_desc_get_handler_data(desc);
 	struct chv_pinctrl *pctrl = gpiochip_to_pinctrl(gc);
drivers/pinctrl/intel/pinctrl-intel.c +1 -1
index a40681097402..a64ca4bd69cd 100644
@@ -836,7 +836,7 @@ static void intel_gpio_community_irq_handler(struct gpio_chip *gc,
 	}
 }
 
-static void intel_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void intel_gpio_irq_handler(struct irq_desc *desc)
 {
 	struct gpio_chip *gc = irq_desc_get_handler_data(desc);
 	struct intel_pinctrl *pctrl = gpiochip_to_pinctrl(gc);
drivers/pinctrl/mediatek/pinctrl-mtk-common.c +1 -1
index fd05ca6125b0..9ec45d4875db 100644
@@ -1016,7 +1016,7 @@ mtk_eint_debounce_process(struct mtk_pinctrl *pctl, int index)
 	}
 }
 
-static void mtk_eint_irq_handler(unsigned irq, struct irq_desc *desc)
+static void mtk_eint_irq_handler(struct irq_desc *desc)
 {
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 	struct mtk_pinctrl *pctl = irq_desc_get_handler_data(desc);
drivers/pinctrl/nomadik/pinctrl-nomadik.c +2 -2
index 902f53b855bf..cd70a30f8d8e 100644
@@ -871,7 +871,7 @@ static void __nmk_gpio_irq_handler(struct irq_desc *desc, u32 status)
 	chained_irq_exit(host_chip, desc);
 }
 
-static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void nmk_gpio_irq_handler(struct irq_desc *desc)
 {
 	struct gpio_chip *chip = irq_desc_get_handler_data(desc);
 	struct nmk_gpio_chip *nmk_chip = container_of(chip, struct nmk_gpio_chip, chip);
@@ -884,7 +884,7 @@ static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
 	__nmk_gpio_irq_handler(desc, status);
 }
 
-static void nmk_gpio_latent_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void nmk_gpio_latent_irq_handler(struct irq_desc *desc)
 {
 	struct gpio_chip *chip = irq_desc_get_handler_data(desc);
 	struct nmk_gpio_chip *nmk_chip = container_of(chip, struct nmk_gpio_chip, chip);
drivers/pinctrl/pinctrl-amd.c +3 -2
index 639cd77c1fbb..08b7e4d543e7 100644
@@ -492,7 +492,7 @@ static struct irq_chip amd_gpio_irqchip = {
 	.irq_set_type = amd_gpio_irq_set_type,
 };
 
-static void amd_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void amd_gpio_irq_handler(struct irq_desc *desc)
 {
 	u32 i;
 	u32 off;
@@ -501,6 +501,7 @@ static void amd_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
 	u64 reg64;
 	int handled = 0;
 	unsigned long flags;
+	unsigned int irq = irq_desc_get_irq(desc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 	struct gpio_chip *gc = irq_desc_get_handler_data(desc);
 	struct amd_gpio *gpio_dev = to_amd_gpio(gc);
@@ -540,7 +541,7 @@ static void amd_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
 	}
 
 	if (handled == 0)
-		handle_bad_irq(irq, desc);
+		handle_bad_irq(desc);
 
 	spin_lock_irqsave(&gpio_dev->lock, flags);
 	reg = readl(gpio_dev->base + WAKE_INT_MASTER_REG);
drivers/pinctrl/pinctrl-at91.c +1 -1
index 92d5f9ec1cce..0145257991fe 100644
@@ -1579,7 +1579,7 @@ static struct irq_chip gpio_irqchip = {
 	.irq_set_wake	= gpio_irq_set_wake,
 };
 
-static void gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void gpio_irq_handler(struct irq_desc *desc)
 {
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 	struct gpio_chip *gpio_chip = irq_desc_get_handler_data(desc);
drivers/pinctrl/pinctrl-coh901.c +2 -1
index 9579442a221d..3b443f23d4a0 100644
@@ -519,8 +519,9 @@ static struct irq_chip u300_gpio_irqchip = {
 	.irq_set_type		= u300_gpio_irq_type,
 };
 
-static void u300_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void u300_gpio_irq_handler(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_to_irq(desc);
 	struct irq_chip *parent_chip = irq_desc_get_chip(desc);
 	struct gpio_chip *chip = irq_desc_get_handler_data(desc);
 	struct u300_gpio *gpio = to_u300_gpio(chip);
drivers/pinctrl/pinctrl-rockchip.c +2 -1
index 97a4a3dddb30..9ea3a0e550ac 100644
@@ -1394,7 +1394,7 @@ static const struct gpio_chip rockchip_gpiolib_chip = {
  * Interrupt handling
  */
 
-static void rockchip_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void rockchip_irq_demux(struct irq_desc *desc)
 {
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 	struct rockchip_pin_bank *bank = irq_desc_get_handler_data(desc);
@@ -1408,6 +1408,7 @@ static void rockchip_irq_demux(unsigned int irq, struct irq_desc *desc)
 
 	while (pend) {
 		unsigned int virq;
+		unsigned int irq;
 
 		irq = __ffs(pend);
 		pend &= ~BIT(irq);
drivers/pinctrl/pinctrl-single.c +1 -1
index a8db57db5f5b..d71cad948bf2 100644
@@ -1679,7 +1679,7 @@ static irqreturn_t pcs_irq_handler(int irq, void *d)
  * Use this if you have a separate interrupt for each
  * pinctrl-single instance.
  */
-static void pcs_irq_chain_handler(unsigned int irq, struct irq_desc *desc)
+static void pcs_irq_chain_handler(struct irq_desc *desc)
 {
 	struct pcs_soc_data *pcs_soc = irq_desc_get_handler_data(desc);
 	struct irq_chip *chip;
drivers/pinctrl/pinctrl-st.c +2 -2
index a4f8d38ed7be..8f92e929582d 100644
@@ -1460,7 +1460,7 @@ static void __gpio_irq_handler(struct st_gpio_bank *bank)
 	}
 }
 
-static void st_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void st_gpio_irq_handler(struct irq_desc *desc)
 {
 	/* interrupt dedicated per bank */
 	struct irq_chip *chip = irq_desc_get_chip(desc);
@@ -1472,7 +1472,7 @@ static void st_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
 	chained_irq_exit(chip, desc);
 }
 
-static void st_gpio_irqmux_handler(unsigned irq, struct irq_desc *desc)
+static void st_gpio_irqmux_handler(struct irq_desc *desc)
 {
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 	struct st_pinctrl *info = irq_desc_get_handler_data(desc);
drivers/pinctrl/qcom/pinctrl-msm.c +2 -2
index 7439d19af0dd..1d2e642130ab 100644
@@ -764,7 +764,7 @@ static struct irq_chip msm_gpio_irq_chip = {
 	.irq_set_wake   = msm_gpio_irq_set_wake,
 };
 
-static void msm_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void msm_gpio_irq_handler(struct irq_desc *desc)
 {
 	struct gpio_chip *gc = irq_desc_get_handler_data(desc);
 	const struct msm_pingroup *g;
@@ -793,7 +793,7 @@ static void msm_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
 
 	/* No interrupts were flagged */
 	if (handled == 0)
-		handle_bad_irq(irq, desc);
+		handle_bad_irq(desc);
 
 	chained_irq_exit(chip, desc);
 }
drivers/pinctrl/samsung/pinctrl-exynos.c +2 -2
index 66fb5ee5a8ae..5a5eba7c697d 100644
@@ -420,7 +420,7 @@ static const struct of_device_id exynos_wkup_irq_ids[] = {
 };
 
 /* interrupt handler for wakeup interrupts 0..15 */
-static void exynos_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
+static void exynos_irq_eint0_15(struct irq_desc *desc)
 {
 	struct exynos_weint_data *eintd = irq_desc_get_handler_data(desc);
 	struct samsung_pin_bank *bank = eintd->bank;
@@ -452,7 +452,7 @@ static inline void exynos_irq_demux_eint(unsigned long pend,
 }
 
 /* interrupt handler for wakeup interrupt 16 */
-static void exynos_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc)
+static void exynos_irq_demux_eint16_31(struct irq_desc *desc)
 {
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 	struct exynos_muxed_weint_data *eintd = irq_desc_get_handler_data(desc);
drivers/pinctrl/samsung/pinctrl-s3c24xx.c +4 -4
index f83e4aeff42c..9b153fda5606 100644
@@ -240,7 +240,7 @@ static struct irq_chip s3c2410_eint0_3_chip = {
 	.irq_set_type	= s3c24xx_eint_type,
 };
 
-static void s3c2410_demux_eint0_3(unsigned int irq, struct irq_desc *desc)
+static void s3c2410_demux_eint0_3(struct irq_desc *desc)
 {
 	struct irq_data *data = irq_desc_get_irq_data(desc);
 	struct s3c24xx_eint_data *eint_data = irq_desc_get_handler_data(desc);
@@ -295,7 +295,7 @@ static struct irq_chip s3c2412_eint0_3_chip = {
 	.irq_set_type	= s3c24xx_eint_type,
 };
 
-static void s3c2412_demux_eint0_3(unsigned int irq, struct irq_desc *desc)
+static void s3c2412_demux_eint0_3(struct irq_desc *desc)
 {
 	struct s3c24xx_eint_data *eint_data = irq_desc_get_handler_data(desc);
 	struct irq_data *data = irq_desc_get_irq_data(desc);
@@ -388,12 +388,12 @@ static inline void s3c24xx_demux_eint(struct irq_desc *desc,
 	chained_irq_exit(chip, desc);
 }
 
-static void s3c24xx_demux_eint4_7(unsigned int irq, struct irq_desc *desc)
+static void s3c24xx_demux_eint4_7(struct irq_desc *desc)
 {
 	s3c24xx_demux_eint(desc, 0, 0xf0);
 }
 
-static void s3c24xx_demux_eint8_23(unsigned int irq, struct irq_desc *desc)
+static void s3c24xx_demux_eint8_23(struct irq_desc *desc)
 {
 	s3c24xx_demux_eint(desc, 8, 0xffff00);
 }
drivers/pinctrl/samsung/pinctrl-s3c64xx.c +5 -5
index 0ffe5db216f7..abd8fcb54ff7 100644
@@ -408,7 +408,7 @@ static const struct irq_domain_ops s3c64xx_gpio_irqd_ops = {
 	.xlate	= irq_domain_xlate_twocell,
 };
 
-static void s3c64xx_eint_gpio_irq(unsigned int irq, struct irq_desc *desc)
+static void s3c64xx_eint_gpio_irq(struct irq_desc *desc)
 {
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 	struct s3c64xx_eint_gpio_data *data = irq_desc_get_handler_data(desc);
@@ -633,22 +633,22 @@ static inline void s3c64xx_irq_demux_eint(struct irq_desc *desc, u32 range)
 	chained_irq_exit(chip, desc);
 }
 
-static void s3c64xx_demux_eint0_3(unsigned int irq, struct irq_desc *desc)
+static void s3c64xx_demux_eint0_3(struct irq_desc *desc)
 {
 	s3c64xx_irq_demux_eint(desc, 0xf);
 }
 
-static void s3c64xx_demux_eint4_11(unsigned int irq, struct irq_desc *desc)
+static void s3c64xx_demux_eint4_11(struct irq_desc *desc)
 {
 	s3c64xx_irq_demux_eint(desc, 0xff0);
 }
 
-static void s3c64xx_demux_eint12_19(unsigned int irq, struct irq_desc *desc)
+static void s3c64xx_demux_eint12_19(struct irq_desc *desc)
 {
 	s3c64xx_irq_demux_eint(desc, 0xff000);
 }
 
-static void s3c64xx_demux_eint20_27(unsigned int irq, struct irq_desc *desc)
+static void s3c64xx_demux_eint20_27(struct irq_desc *desc)
 {
 	s3c64xx_irq_demux_eint(desc, 0xff00000);
 }
drivers/pinctrl/sirf/pinctrl-sirf.c +3 -2
index 46cafde08ebf..d3659688f440 100644
@@ -545,8 +545,9 @@ static struct irq_chip sirfsoc_irq_chip = {
 	.irq_set_type = sirfsoc_gpio_irq_type,
 };
 
-static void sirfsoc_gpio_handle_irq(unsigned int irq, struct irq_desc *desc)
+static void sirfsoc_gpio_handle_irq(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_get_irq(desc);
 	struct gpio_chip *gc = irq_desc_get_handler_data(desc);
 	struct sirfsoc_gpio_chip *sgpio = to_sirfsoc_gpio(gc);
 	struct sirfsoc_gpio_bank *bank;
@@ -569,7 +570,7 @@ static void sirfsoc_gpio_handle_irq(unsigned int irq, struct irq_desc *desc)
 		printk(KERN_WARNING
 			"%s: gpio id %d status %#x no interrupt is flagged\n",
 			__func__, bank->id, status);
-		handle_bad_irq(irq, desc);
+		handle_bad_irq(desc);
 		return;
 	}
 
drivers/pinctrl/spear/pinctrl-plgpio.c +1 -1
index ae8f29fb5536..1f0af250dbb5 100644
@@ -356,7 +356,7 @@ static struct irq_chip plgpio_irqchip = {
 	.irq_set_type	= plgpio_irq_set_type,
 };
 
-static void plgpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void plgpio_irq_handler(struct irq_desc *desc)
 {
 	struct gpio_chip *gc = irq_desc_get_handler_data(desc);
 	struct plgpio *plgpio = container_of(gc, struct plgpio, chip);
drivers/pinctrl/sunxi/pinctrl-sunxi.c +2 -1
index 563cec6dc24e..12c78f7330d2 100644
@@ -709,8 +709,9 @@ static struct irq_chip sunxi_pinctrl_level_irq_chip = {
 			  IRQCHIP_EOI_IF_HANDLED,
 };
 
-static void sunxi_pinctrl_irq_handler(unsigned irq, struct irq_desc *desc)
+static void sunxi_pinctrl_irq_handler(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_get_irq(desc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 	struct sunxi_pinctrl *pctl = irq_desc_get_handler_data(desc);
 	unsigned long bank, reg, val;
Signature · 1 line
1.7.10.4
author
#62 lore raw

RFC 22/25 genirq: Kill the first parameter 'irq' of irq_flow_handler_t

In reply to Jiang Liu

Now most IRQ flow handlers make no use of the first parameter 'irq'. And for those who do make use of 'irq', we could easily get the irq number through irq_desc->irq_data->irq. So kill the first parameter 'irq' of irq_flow_handler_t.

To ease review, I have split the changes into several parts, though they should be merge as one to support bisecting.

---
 drivers/gpio/gpio-altera.c     |    6 ++----
 drivers/gpio/gpio-bcm-kona.c   |    2 +-
 drivers/gpio/gpio-davinci.c    |    3 ++-
 drivers/gpio/gpio-dwapb.c      |    2 +-
 drivers/gpio/gpio-ep93xx.c     |    5 +++--
 drivers/gpio/gpio-intel-mid.c  |    2 +-
 drivers/gpio/gpio-lynxpoint.c  |    2 +-
 drivers/gpio/gpio-mpc8xxx.c    |    2 +-
 drivers/gpio/gpio-msic.c       |    2 +-
 drivers/gpio/gpio-msm-v2.c     |    2 +-
 drivers/gpio/gpio-mvebu.c      |    2 +-
 drivers/gpio/gpio-mxc.c        |    4 ++--
 drivers/gpio/gpio-mxs.c        |    2 +-
 drivers/gpio/gpio-omap.c       |    2 +-
 drivers/gpio/gpio-pl061.c      |    2 +-
 drivers/gpio/gpio-pxa.c        |    2 +-
 drivers/gpio/gpio-sa1100.c     |    4 ++--
 drivers/gpio/gpio-tegra.c      |    2 +-
 drivers/gpio/gpio-timberdale.c |    5 +++--
 drivers/gpio/gpio-tz1090.c     |    4 ++--
 drivers/gpio/gpio-vf610.c      |    2 +-
 drivers/gpio/gpio-zynq.c       |    2 +-
 22 files changed, 31 insertions(+), 30 deletions(-)
drivers/gpio/gpio-altera.c +2 -4
index 449fb46cb8a0..985c3bd9a03e 100644
@@ -200,8 +200,7 @@ static int altera_gpio_direction_output(struct gpio_chip *gc,
 	return 0;
 }
 
-static void altera_gpio_irq_edge_handler(unsigned int irq,
-					struct irq_desc *desc)
+static void altera_gpio_irq_edge_handler(struct irq_desc *desc)
 {
 	struct altera_gpio_chip *altera_gc;
 	struct irq_chip *chip;
@@ -230,8 +229,7 @@ static void altera_gpio_irq_edge_handler(unsigned int irq,
 }
 
 
-static void altera_gpio_irq_leveL_high_handler(unsigned int irq,
-					      struct irq_desc *desc)
+static void altera_gpio_irq_leveL_high_handler(struct irq_desc *desc)
 {
 	struct altera_gpio_chip *altera_gc;
 	struct irq_chip *chip;
drivers/gpio/gpio-bcm-kona.c +1 -1
index 2e7a8c66fe57..6471892f4f83 100644
@@ -427,7 +427,7 @@ static int bcm_kona_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 	return 0;
 }
 
-static void bcm_kona_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void bcm_kona_gpio_irq_handler(struct irq_desc *desc)
 {
 	void __iomem *reg_base;
 	int bit, bank_id;
drivers/gpio/gpio-davinci.c +2 -1
index 477d5b8616ab..31206ea4c84e 100644
@@ -327,8 +327,9 @@ static struct irq_chip gpio_irqchip = {
 };
 
 static void
-gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+gpio_irq_handler(struct irq_desc *desc)
 {
+	unsigned irq = irq_desc_get_irq(desc);
 	struct davinci_gpio_regs __iomem *g;
 	u32 mask = 0xffff;
 	struct davinci_gpio_controller *d;
drivers/gpio/gpio-dwapb.c +1 -1
index 649be07a845d..bf7cb1be756d 100644
@@ -147,7 +147,7 @@ static u32 dwapb_do_irq(struct dwapb_gpio *gpio)
 	return ret;
 }
 
-static void dwapb_irq_handler(u32 irq, struct irq_desc *desc)
+static void dwapb_irq_handler(struct irq_desc *desc)
 {
 	struct dwapb_gpio *gpio = irq_desc_get_handler_data(desc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
drivers/gpio/gpio-ep93xx.c +3 -2
index 45684f36ddb1..03648a8a6f8e 100644
@@ -78,7 +78,7 @@ static void ep93xx_gpio_int_debounce(unsigned int irq, bool enable)
 		EP93XX_GPIO_REG(int_debounce_register_offset[port]));
 }
 
-static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void ep93xx_gpio_ab_irq_handler(struct irq_desc *desc)
 {
 	unsigned char status;
 	int i;
@@ -100,13 +100,14 @@ static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc)
 	}
 }
 
-static void ep93xx_gpio_f_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void ep93xx_gpio_f_irq_handler(struct irq_desc *desc)
 {
 	/*
 	 * map discontiguous hw irq range to continuous sw irq range:
 	 *
 	 *  IRQ_EP93XX_GPIO{0..7}MUX -> gpio_to_irq(EP93XX_GPIO_LINE_F({0..7})
 	 */
+	unsigned int irq = irq_desc_get_irq(desc);
 	int port_f_idx = ((irq + 1) & 7) ^ 4; /* {19..22,47..50} -> {0..7} */
 	int gpio_irq = gpio_to_irq(EP93XX_GPIO_LINE_F(0)) + port_f_idx;
 
drivers/gpio/gpio-intel-mid.c +1 -1
index aa28c65eb6b4..70097472b02c 100644
@@ -301,7 +301,7 @@ static const struct pci_device_id intel_gpio_ids[] = {
 };
 MODULE_DEVICE_TABLE(pci, intel_gpio_ids);
 
-static void intel_mid_irq_handler(unsigned irq, struct irq_desc *desc)
+static void intel_mid_irq_handler(struct irq_desc *desc)
 {
 	struct gpio_chip *gc = irq_desc_get_handler_data(desc);
 	struct intel_mid_gpio *priv = to_intel_gpio_priv(gc);
drivers/gpio/gpio-lynxpoint.c +1 -1
index 127c755b38dc..23e884aefe36 100644
@@ -234,7 +234,7 @@ static int lp_gpio_direction_output(struct gpio_chip *chip,
 	return 0;
 }
 
-static void lp_gpio_irq_handler(unsigned hwirq, struct irq_desc *desc)
+static void lp_gpio_irq_handler(struct irq_desc *desc)
 {
 	struct irq_data *data = irq_desc_get_irq_data(desc);
 	struct gpio_chip *gc = irq_desc_get_handler_data(desc);
drivers/gpio/gpio-mpc8xxx.c +1 -1
index a65b75161aa4..281dea4d2e39 100644
@@ -185,7 +185,7 @@ static int mpc8xxx_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
 		return -ENXIO;
 }
 
-static void mpc8xxx_gpio_irq_cascade(unsigned int irq, struct irq_desc *desc)
+static void mpc8xxx_gpio_irq_cascade(struct irq_desc *desc)
 {
 	struct mpc8xxx_gpio_chip *mpc8xxx_gc = irq_desc_get_handler_data(desc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
drivers/gpio/gpio-msic.c +1 -1
index 01acf0a8cdb1..35b3046d1c7d 100644
@@ -232,7 +232,7 @@ static struct irq_chip msic_irqchip = {
 	.irq_bus_sync_unlock	= msic_bus_sync_unlock,
 };
 
-static void msic_gpio_irq_handler(unsigned irq, struct irq_desc *desc)
+static void msic_gpio_irq_handler(struct irq_desc *desc)
 {
 	struct irq_data *data = irq_desc_get_irq_data(desc);
 	struct msic_gpio *mg = irq_data_get_irq_handler_data(data);
drivers/gpio/gpio-msm-v2.c +1 -1
index 52ff18229fdc..f4a69e005409 100644
@@ -313,7 +313,7 @@ static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int flow_type)
  * which have been set as summary IRQ lines and which are triggered,
  * and to call their interrupt handlers.
  */
-static void msm_summary_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void msm_summary_irq_handler(struct irq_desc *desc)
 {
 	unsigned long i;
 	struct irq_chip *chip = irq_desc_get_chip(desc);
drivers/gpio/gpio-mvebu.c +1 -1
index a8c302ef7bc4..5b12549e3d6c 100644
@@ -458,7 +458,7 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 	return 0;
 }
 
-static void mvebu_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void mvebu_gpio_irq_handler(struct irq_desc *desc)
 {
 	struct mvebu_gpio_chip *mvchip = irq_desc_get_handler_data(desc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
drivers/gpio/gpio-mxc.c +2 -2
index f10948c04f7c..1f5186002326 100644
@@ -272,7 +272,7 @@ static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat)
 }
 
 /* MX1 and MX3 has one interrupt *per* gpio port */
-static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc)
+static void mx3_gpio_irq_handler(struct irq_desc *desc)
 {
 	u32 irq_stat;
 	struct mxc_gpio_port *port = irq_desc_get_handler_data(desc);
@@ -288,7 +288,7 @@ static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc)
 }
 
 /* MX2 has one interrupt *for all* gpio ports */
-static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc)
+static void mx2_gpio_irq_handler(struct irq_desc *desc)
 {
 	u32 irq_msk, irq_stat;
 	struct mxc_gpio_port *port;
drivers/gpio/gpio-mxs.c +1 -1
index 039c7d50e64f..e5b286e9f016 100644
@@ -154,7 +154,7 @@ static void mxs_flip_edge(struct mxs_gpio_port *port, u32 gpio)
 }
 
 /* MXS has one interrupt *per* gpio port */
-static void mxs_gpio_irq_handler(u32 irq, struct irq_desc *desc)
+static void mxs_gpio_irq_handler(struct irq_desc *desc)
 {
 	u32 irq_stat;
 	struct mxs_gpio_port *port = irq_desc_get_handler_data(desc);
drivers/gpio/gpio-omap.c +1 -1
index acbf3feff1e2..7f764d786efe 100644
@@ -711,7 +711,7 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset)
  * line's interrupt handler has been run, we may miss some nested
  * interrupts.
  */
-static void omap_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void omap_gpio_irq_handler(struct irq_desc *desc)
 {
 	void __iomem *isr_reg = NULL;
 	u32 isr;
drivers/gpio/gpio-pl061.c +1 -1
index 04756130437f..229ef653e0f8 100644
@@ -187,7 +187,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger)
 	return 0;
 }
 
-static void pl061_irq_handler(unsigned irq, struct irq_desc *desc)
+static void pl061_irq_handler(struct irq_desc *desc)
 {
 	unsigned long pending;
 	int offset;
drivers/gpio/gpio-pxa.c +1 -1
index cdbbcf0faf9d..a6d51338b86e 100644
@@ -401,7 +401,7 @@ static int pxa_gpio_irq_type(struct irq_data *d, unsigned int type)
 	return 0;
 }
 
-static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
+static void pxa_gpio_demux_handler(struct irq_desc *desc)
 {
 	struct pxa_gpio_chip *c;
 	int loop, gpio, gpio_base, n;
drivers/gpio/gpio-sa1100.c +2 -2
index bec397a60204..cde43049d5f6 100644
@@ -173,9 +173,9 @@ static struct irq_domain *sa1100_gpio_irqdomain;
  * and call the handler.
  */
 static void
-sa1100_gpio_handler(unsigned int irq, struct irq_desc *desc)
+sa1100_gpio_handler(struct irq_desc *desc)
 {
-	unsigned int mask;
+	unsigned int mask, irq;
 
 	mask = GEDR;
 	do {
drivers/gpio/gpio-tegra.c +1 -1
index 89ed8a56eb0b..bfd5f39d1bc3 100644
@@ -266,7 +266,7 @@ static void tegra_gpio_irq_shutdown(struct irq_data *d)
 	gpiochip_unlock_as_irq(&tegra_gpio_chip, gpio);
 }
 
-static void tegra_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void tegra_gpio_irq_handler(struct irq_desc *desc)
 {
 	int port;
 	int pin;
drivers/gpio/gpio-timberdale.c +3 -2
index d4e8cb4f2e53..107094139ec4 100644
@@ -192,13 +192,14 @@ out:
 	return ret;
 }
 
-static void timbgpio_irq(unsigned int irq, struct irq_desc *desc)
+static void timbgpio_irq(struct irq_desc *desc)
 {
 	struct timbgpio *tgpio = irq_desc_get_handler_data(desc);
+	struct irq_data *data = irq_desc_get_irq_data(desc);
 	unsigned long ipr;
 	int offset;
 
-	desc->irq_data.chip->irq_ack(irq_get_irq_data(irq));
+	data->chip->irq_ack(data);
 	ipr = ioread32(tgpio->membase + TGPIO_IPR);
 	iowrite32(ipr, tgpio->membase + TGPIO_ICR);
 
drivers/gpio/gpio-tz1090.c +2 -2
index 445660adc898..58dfa595dbd7 100644
@@ -375,7 +375,7 @@ static int gpio_set_irq_wake(struct irq_data *data, unsigned int on)
 #define gpio_set_irq_wake NULL
 #endif
 
-static void tz1090_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void tz1090_gpio_irq_handler(struct irq_desc *desc)
 {
 	irq_hw_number_t hw;
 	unsigned int irq_stat, irq_no;
@@ -400,7 +400,7 @@ static void tz1090_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
 				== IRQ_TYPE_EDGE_BOTH)
 			tz1090_gpio_irq_next_edge(bank, hw);
 
-		generic_handle_irq_desc(irq_no, child_desc);
+		generic_handle_irq_desc(child_desc);
 	}
 }
 
drivers/gpio/gpio-vf610.c +1 -1
index fa344388f4da..18d0ae80dc4a 100644
@@ -118,7 +118,7 @@ static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
 	return pinctrl_gpio_direction_output(chip->base + gpio);
 }
 
-static void vf610_gpio_irq_handler(u32 irq, struct irq_desc *desc)
+static void vf610_gpio_irq_handler(struct irq_desc *desc)
 {
 	struct vf610_gpio_port *port = irq_desc_get_handler_data(desc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
drivers/gpio/gpio-zynq.c +1 -1
index 70e3a568b1cb..92d91d3b6dd7 100644
@@ -495,7 +495,7 @@ static void zynq_gpio_handle_bank_irq(struct zynq_gpio *gpio,
  * application for that pin.
  * Note: A bug is reported if no handler is set for the gpio pin.
  */
-static void zynq_gpio_irqhandler(unsigned int irq, struct irq_desc *desc)
+static void zynq_gpio_irqhandler(struct irq_desc *desc)
 {
 	u32 int_sts, int_enb;
 	unsigned int bank_num;
Signature · 1 line
1.7.10.4
author
#63 lore raw

RFC 23/25 genirq: Kill the first parameter 'irq' of irq_flow_handler_t

In reply to Jiang Liu

Now most IRQ flow handlers make no use of the first parameter 'irq'. And for those who do make use of 'irq', we could easily get the irq number through irq_desc->irq_data->irq. So kill the first parameter 'irq' of irq_flow_handler_t.

To ease review, I have split the changes into several parts, though they should be merge as one to support bisecting.

---
 drivers/irqchip/exynos-combiner.c    |    4 ++--
 drivers/irqchip/irq-bcm7038-l1.c     |    2 +-
 drivers/irqchip/irq-bcm7120-l2.c     |    2 +-
 drivers/irqchip/irq-brcmstb-l2.c     |    6 +++---
 drivers/irqchip/irq-dw-apb-ictl.c    |    2 +-
 drivers/irqchip/irq-gic.c            |    2 +-
 drivers/irqchip/irq-imgpdc.c         |    5 +++--
 drivers/irqchip/irq-keystone.c       |    3 ++-
 drivers/irqchip/irq-metag-ext.c      |    3 +--
 drivers/irqchip/irq-metag.c          |    3 +--
 drivers/irqchip/irq-mips-gic.c       |    2 +-
 drivers/irqchip/irq-mmp.c            |    3 ++-
 drivers/irqchip/irq-orion.c          |    2 +-
 drivers/irqchip/irq-s3c24xx.c        |    3 ++-
 drivers/irqchip/irq-sunxi-nmi.c      |    2 +-
 drivers/irqchip/irq-tb10x.c          |    4 ++--
 drivers/irqchip/irq-versatile-fpga.c |    6 +++---
 drivers/irqchip/irq-vic.c            |    2 +-
 drivers/irqchip/spear-shirq.c        |    2 +-
 19 files changed, 30 insertions(+), 28 deletions(-)
drivers/irqchip/exynos-combiner.c +2 -2
index 039ceb46fcc0..2bf152307bac 100644
@@ -60,7 +60,7 @@ static void combiner_unmask_irq(struct irq_data *data)
 	__raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_SET);
 }
 
-static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
+static void combiner_handle_cascade_irq(struct irq_desc *desc)
 {
 	struct combiner_chip_data *chip_data = irq_desc_get_handler_data(desc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
@@ -81,7 +81,7 @@ static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
 	cascade_irq = irq_find_mapping(combiner_irq_domain, combiner_irq);
 
 	if (unlikely(!cascade_irq))
-		handle_bad_irq(irq, desc);
+		handle_bad_irq(desc);
 	else
 		generic_handle_irq(cascade_irq);
 
drivers/irqchip/irq-bcm7038-l1.c +1 -1
index d3b8c8be15f6..9ad6540bd57e 100644
@@ -116,7 +116,7 @@ static inline void l1_writel(u32 val, void __iomem *reg)
 		writel(val, reg);
 }
 
-static void bcm7038_l1_irq_handle(unsigned int irq, struct irq_desc *desc)
+static void bcm7038_l1_irq_handle(struct irq_desc *desc)
 {
 	struct bcm7038_l1_chip *intc = irq_desc_get_handler_data(desc);
 	struct bcm7038_l1_cpu *cpu;
drivers/irqchip/irq-bcm7120-l2.c +1 -1
index 3ba5cc780fcb..4ee0d839009e 100644
@@ -52,7 +52,7 @@ struct bcm7120_l2_intc_data {
 	const __be32 *map_mask_prop;
 };
 
-static void bcm7120_l2_intc_irq_handle(unsigned int irq, struct irq_desc *desc)
+static void bcm7120_l2_intc_irq_handle(struct irq_desc *desc)
 {
 	struct bcm7120_l2_intc_data *b = irq_desc_get_handler_data(desc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
drivers/irqchip/irq-brcmstb-l2.c +3 -3
index d6bcc6be0777..f82b96a514fe 100644
@@ -51,7 +51,7 @@ struct brcmstb_l2_intc_data {
 	u32 saved_mask; /* for suspend/resume */
 };
 
-static void brcmstb_l2_intc_irq_handle(unsigned int irq, struct irq_desc *desc)
+static void brcmstb_l2_intc_irq_handle(struct irq_desc *desc)
 {
 	struct brcmstb_l2_intc_data *b = irq_desc_get_handler_data(desc);
 	struct irq_chip_generic *gc = irq_get_domain_generic_chip(b->domain, 0);
@@ -65,13 +65,13 @@ static void brcmstb_l2_intc_irq_handle(unsigned int irq, struct irq_desc *desc)
 
 	if (status == 0) {
 		raw_spin_lock(&desc->lock);
-		handle_bad_irq(irq, desc);
+		handle_bad_irq(desc);
 		raw_spin_unlock(&desc->lock);
 		goto out;
 	}
 
 	do {
-		irq = ffs(status) - 1;
+		unsigned int irq = ffs(status) - 1;
 		/* ack at our level */
 		irq_reg_writel(gc, 1 << irq, CPU_CLEAR);
 		status &= ~(1 << irq);
drivers/irqchip/irq-dw-apb-ictl.c +1 -1
index cddcd3b75f00..7a00d7822228 100644
@@ -26,7 +26,7 @@
 #define APB_INT_FINALSTATUS_L	0x30
 #define APB_INT_FINALSTATUS_H	0x34
 
-static void dw_apb_ictl_handler(unsigned int irq, struct irq_desc *desc)
+static void dw_apb_ictl_handler(struct irq_desc *desc)
 {
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 	struct irq_chip_generic *gc = irq_desc_get_handler_data(desc);
drivers/irqchip/irq-gic.c +1 -1
index 6c8a5a7fb4a0..e24d240a8fe8 100644
@@ -286,7 +286,7 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs)
 	} while (1);
 }
 
-static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
+static void gic_handle_cascade_irq(struct irq_desc *desc)
 {
 	struct gic_chip_data *chip_data = irq_desc_get_handler_data(desc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
drivers/irqchip/irq-imgpdc.c +3 -2
index 8071c2eb0248..5d8a482100f7 100644
@@ -218,8 +218,9 @@ static int pdc_irq_set_wake(struct irq_data *data, unsigned int on)
 	return 0;
 }
 
-static void pdc_intc_perip_isr(unsigned int irq, struct irq_desc *desc)
+static void pdc_intc_perip_isr(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_get_irq(desc);
 	struct pdc_intc_priv *priv;
 	unsigned int i, irq_no;
 
@@ -239,7 +240,7 @@ found:
 	generic_handle_irq(irq_no);
 }
 
-static void pdc_intc_syswake_isr(unsigned int irq, struct irq_desc *desc)
+static void pdc_intc_syswake_isr(struct irq_desc *desc)
 {
 	struct pdc_intc_priv *priv;
 	unsigned int syswake, irq_no;
drivers/irqchip/irq-keystone.c +2 -1
index 78e8b3ce5252..f97a65ef5f8c 100644
@@ -84,8 +84,9 @@ static void keystone_irq_ack(struct irq_data *d)
 	/* nothing to do here */
 }
 
-static void keystone_irq_handler(unsigned irq, struct irq_desc *desc)
+static void keystone_irq_handler(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_get_irq(desc);
 	struct keystone_irq_device *kirq = irq_desc_get_handler_data(desc);
 	unsigned long pending;
 	int src, virq;
drivers/irqchip/irq-metag-ext.c +1 -2
index 52e501d8c8f0..f4b46643f2d2 100644
@@ -436,7 +436,6 @@ static int meta_intc_irq_set_type(struct irq_data *data, unsigned int flow_type)
 
 /**
  * meta_intc_irq_demux() - external irq de-multiplexer
- * @irq:	the virtual interrupt number
  * @desc:	the interrupt description structure for this irq
  *
  * The cpu receives an interrupt on TR2 when a SoC interrupt has occurred. It is
@@ -446,7 +445,7 @@ static int meta_intc_irq_set_type(struct irq_data *data, unsigned int flow_type)
  * Whilst using TR2 to detect external interrupts is a software convention it is
  * (hopefully) unlikely to change.
  */
-static void meta_intc_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void meta_intc_irq_demux(struct irq_desc *desc)
 {
 	struct meta_intc_priv *priv = &meta_intc_priv;
 	irq_hw_number_t hw;
drivers/irqchip/irq-metag.c +1 -2
index c16c186d97d3..f806a61d6660 100644
@@ -213,14 +213,13 @@ static int metag_internal_irq_set_affinity(struct irq_data *data,
 
 /*
  *	metag_internal_irq_demux - irq de-multiplexer
- *	@irq:	the interrupt number
  *	@desc:	the interrupt description structure for this irq
  *
  *	The cpu receives an interrupt on TR1 when an interrupt has
  *	occurred. It is this function's job to demux this irq and
  *	figure out exactly which trigger needs servicing.
  */
-static void metag_internal_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void metag_internal_irq_demux(struct irq_desc *desc)
 {
 	struct metag_internal_irq_priv *priv = irq_desc_get_handler_data(desc);
 	irq_hw_number_t hw;
drivers/irqchip/irq-mips-gic.c +1 -1
index fb2e64b1f414..36d6b457e8e9 100644
@@ -510,7 +510,7 @@ static void __gic_irq_dispatch(void)
 	gic_handle_shared_int();
 }
 
-static void gic_irq_dispatch(unsigned int irq, struct irq_desc *desc)
+static void gic_irq_dispatch(struct irq_desc *desc)
 {
 	__gic_irq_dispatch();
 }
drivers/irqchip/irq-mmp.c +2 -1
index c0da57bdb89d..bde3bbd245a4 100644
@@ -130,8 +130,9 @@ struct irq_chip icu_irq_chip = {
 	.irq_unmask	= icu_unmask_irq,
 };
 
-static void icu_mux_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void icu_mux_irq_demux(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_get_irq(desc);
 	struct irq_domain *domain;
 	struct icu_chip_data *data;
 	int i;
drivers/irqchip/irq-orion.c +1 -1
index 58e034db0e7c..9e5a36cd1b8f 100644
@@ -107,7 +107,7 @@ IRQCHIP_DECLARE(orion_intc, "marvell,orion-intc", orion_irq_init);
 #define ORION_BRIDGE_IRQ_CAUSE	0x00
 #define ORION_BRIDGE_IRQ_MASK	0x04
 
-static void orion_bridge_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void orion_bridge_irq_handler(struct irq_desc *desc)
 {
 	struct irq_domain *d = irq_desc_get_handler_data(desc);
 
drivers/irqchip/irq-s3c24xx.c +2 -1
index c8d373fcd823..885b4bacf5ad 100644
@@ -299,7 +299,7 @@ static struct irq_chip s3c_irq_eint0t4 = {
 	.irq_set_type	= s3c_irqext0_type,
 };
 
-static void s3c_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void s3c_irq_demux(struct irq_desc *desc)
 {
 	struct irq_chip *chip = irq_desc_get_chip(desc);
 	struct s3c_irq_data *irq_data = irq_desc_get_chip_data(desc);
@@ -309,6 +309,7 @@ static void s3c_irq_demux(unsigned int irq, struct irq_desc *desc)
 	unsigned long msk;
 	unsigned int n;
 	unsigned int offset;
+	unsigned int irq;
 
 	/* we're using individual domains for the non-dt case
 	 * and one big domain for the dt case where the subintc
drivers/irqchip/irq-sunxi-nmi.c +1 -1
index 2eaa9d9df241..4e16ccd398f8 100644
@@ -58,7 +58,7 @@ static inline u32 sunxi_sc_nmi_read(struct irq_chip_generic *gc, u32 off)
 	return irq_reg_readl(gc, off);
 }
 
-static void sunxi_sc_nmi_handle_irq(unsigned int irq, struct irq_desc *desc)
+static void sunxi_sc_nmi_handle_irq(struct irq_desc *desc)
 {
 	struct irq_domain *domain = irq_desc_get_handler_data(desc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
drivers/irqchip/irq-tb10x.c +2 -2
index accc20036a3c..bdcc39218d46 100644
@@ -97,11 +97,11 @@ static int tb10x_irq_set_type(struct irq_data *data, unsigned int flow_type)
 	return IRQ_SET_MASK_OK;
 }
 
-static void tb10x_irq_cascade(unsigned int irq, struct irq_desc *desc)
+static void tb10x_irq_cascade(struct irq_desc *desc)
 {
 	struct irq_domain *domain = irq_desc_get_handler_data(desc);
 
-	generic_handle_irq(irq_find_mapping(domain, irq));
+	generic_handle_irq(irq_find_mapping(domain, irq_desc_get_irq(desc)));
 }
 
 static int __init of_tb10x_init_irq(struct device_node *ictl,
drivers/irqchip/irq-versatile-fpga.c +3 -3
index 1ab451729a5c..6ce21c1e9fff 100644
@@ -66,18 +66,18 @@ static void fpga_irq_unmask(struct irq_data *d)
 	writel(mask, f->base + IRQ_ENABLE_SET);
 }
 
-static void fpga_irq_handle(unsigned int irq, struct irq_desc *desc)
+static void fpga_irq_handle(struct irq_desc *desc)
 {
 	struct fpga_irq_data *f = irq_desc_get_handler_data(desc);
 	u32 status = readl(f->base + IRQ_STATUS);
 
 	if (status == 0) {
-		do_bad_IRQ(irq, desc);
+		do_bad_IRQ(desc);
 		return;
 	}
 
 	do {
-		irq = ffs(status) - 1;
+		unsigned int irq = ffs(status) - 1;
 		status &= ~(1 << irq);
 		generic_handle_irq(irq_find_mapping(f->domain, irq));
 	} while (status);
drivers/irqchip/irq-vic.c +1 -1
index 54089debf2dc..9f090e4284e4 100644
@@ -226,7 +226,7 @@ static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs)
 	return handled;
 }
 
-static void vic_handle_irq_cascaded(unsigned int irq, struct irq_desc *desc)
+static void vic_handle_irq_cascaded(struct irq_desc *desc)
 {
 	u32 stat, hwirq;
 	struct irq_chip *host_chip = irq_desc_get_chip(desc);
drivers/irqchip/spear-shirq.c +1 -1
index fb68ee9c0424..1396f0fad479 100644
@@ -183,7 +183,7 @@ static struct spear_shirq *spear320_shirq_blocks[] = {
 	&spear320_shirq_intrcomm_ras,
 };
 
-static void shirq_handler(unsigned irq, struct irq_desc *desc)
+static void shirq_handler(struct irq_desc *desc)
 {
 	struct spear_shirq *shirq = irq_desc_get_handler_data(desc);
 	u32 pend;
Signature · 1 line
1.7.10.4
author
#64 lore raw

RFC 24/25 genirq: Kill the first parameter 'irq' of irq_flow_handler_t

In reply to Jiang Liu

Now most IRQ flow handlers make no use of the first parameter 'irq'. And for those who do make use of 'irq', we could easily get the irq number through irq_desc->irq_data->irq. So kill the first parameter 'irq' of irq_flow_handler_t.

To ease review, I have split the changes into several parts, though they should be merge as one to support bisecting.

---
 drivers/mfd/asic3.c        |    2 +-
 drivers/mfd/ezx-pcap.c     |    2 +-
 drivers/mfd/htc-egpio.c    |    2 +-
 drivers/mfd/jz4740-adc.c   |    2 +-
 drivers/mfd/pm8921-core.c  |    2 +-
 drivers/mfd/t7l66xb.c      |    2 +-
 drivers/mfd/tc6393xb.c     |    2 +-
 drivers/mfd/ucb1x00-core.c |    4 ++--
 8 files changed, 9 insertions(+), 9 deletions(-)
drivers/mfd/asic3.c +1 -1
index 977bd3a3eed0..6bf17842a3e4 100644
@@ -138,7 +138,7 @@ static void asic3_irq_flip_edge(struct asic3 *asic,
 	spin_unlock_irqrestore(&asic->lock, flags);
 }
 
-static void asic3_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void asic3_irq_demux(struct irq_desc *desc)
 {
 	struct asic3 *asic = irq_desc_get_handler_data(desc);
 	struct irq_data *data = irq_desc_get_irq_data(desc);
drivers/mfd/ezx-pcap.c +1 -1
index e5f4ffaa5414..ab83124d75f7 100644
@@ -205,7 +205,7 @@ static void pcap_isr_work(struct work_struct *work)
 	} while (gpio_get_value(pdata->gpio));
 }
 
-static void pcap_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void pcap_irq_handler(struct irq_desc *desc)
 {
 	struct pcap_chip *pcap = irq_desc_get_handler_data(desc);
 
drivers/mfd/htc-egpio.c +1 -1
index 49f39feca784..8a3264e35403 100644
@@ -98,7 +98,7 @@ static struct irq_chip egpio_muxed_chip = {
 	.irq_unmask	= egpio_unmask,
 };
 
-static void egpio_handler(unsigned int irq, struct irq_desc *desc)
+static void egpio_handler(struct irq_desc *desc)
 {
 	struct egpio_info *ei = irq_desc_get_handler_data(desc);
 	int irqpin;
drivers/mfd/jz4740-adc.c +1 -1
index b31c54e4ecb2..ec1cd2297ea4 100644
@@ -65,7 +65,7 @@ struct jz4740_adc {
 	spinlock_t lock;
 };
 
-static void jz4740_adc_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void jz4740_adc_irq_demux(struct irq_desc *desc)
 {
 	struct irq_chip_generic *gc = irq_desc_get_handler_data(desc);
 	uint8_t status;
drivers/mfd/pm8921-core.c +1 -1
index 5a92646a2ccb..87dd27e49a8b 100644
@@ -156,7 +156,7 @@ static int pm8xxx_irq_master_handler(struct pm_irq_chip *chip, int master)
 	return ret;
 }
 
-static void pm8xxx_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void pm8xxx_irq_handler(struct irq_desc *desc)
 {
 	struct pm_irq_chip *chip = irq_desc_get_handler_data(desc);
 	struct irq_chip *irq_chip = irq_desc_get_chip(desc);
drivers/mfd/t7l66xb.c +1 -1
index b752ca2be549..55ade59303b1 100644
@@ -185,7 +185,7 @@ static struct mfd_cell t7l66xb_cells[] = {
 /*--------------------------------------------------------------------------*/
 
 /* Handle the T7L66XB interrupt mux */
-static void t7l66xb_irq(unsigned int irq, struct irq_desc *desc)
+static void t7l66xb_irq(struct irq_desc *desc)
 {
 	struct t7l66xb *t7l66xb = irq_desc_get_handler_data(desc);
 	unsigned int isr;
drivers/mfd/tc6393xb.c +1 -1
index d21253a51cff..e22722cd667c 100644
@@ -523,7 +523,7 @@ static int tc6393xb_register_gpio(struct tc6393xb *tc6393xb, int gpio_base)
 /*--------------------------------------------------------------------------*/
 
 static void
-tc6393xb_irq(unsigned int irq, struct irq_desc *desc)
+tc6393xb_irq(struct irq_desc *desc)
 {
 	struct tc6393xb *tc6393xb = irq_desc_get_handler_data(desc);
 	unsigned int isr;
drivers/mfd/ucb1x00-core.c +2 -2
index 58ea9fdd3a15..2f8f922a34de 100644
@@ -282,7 +282,7 @@ void ucb1x00_adc_disable(struct ucb1x00 *ucb)
  * SIBCLK to talk to the chip.  We leave the clock running until
  * we have finished processing all interrupts from the chip.
  */
-static void ucb1x00_irq(unsigned int irq, struct irq_desc *desc)
+static void ucb1x00_irq(struct irq_desc *desc)
 {
 	struct ucb1x00 *ucb = irq_desc_get_handler_data(desc);
 	unsigned int isr, i;
@@ -292,7 +292,7 @@ static void ucb1x00_irq(unsigned int irq, struct irq_desc *desc)
 	ucb1x00_reg_write(ucb, UCB_IE_CLEAR, isr);
 	ucb1x00_reg_write(ucb, UCB_IE_CLEAR, 0);
 
-	for (i = 0; i < 16 && isr; i++, isr >>= 1, irq++)
+	for (i = 0; i < 16 && isr; i++, isr >>= 1)
 		if (isr & 1)
 			generic_handle_irq(ucb->irq_base + i);
 	ucb1x00_disable(ucb);
Signature · 1 line
1.7.10.4
Acked-by on v1 24/25
#65 lore raw

Re: [RFC v1 24/25] genirq: Kill the first parameter 'irq' of irq_flow_handler_t

Quoted 9 lines · Jiang Liu

Now most IRQ flow handlers make no use of the first parameter 'irq'. And for those who do make use of 'irq', we could easily get the irq number through irq_desc->irq_data->irq. So kill the first parameter 'irq' of irq_flow_handler_t.

To ease review, I have split the changes into several parts, though they should be merge as one to support bisecting.

Quoted 10 lines
---
 drivers/mfd/asic3.c        |    2 +-
 drivers/mfd/ezx-pcap.c     |    2 +-
 drivers/mfd/htc-egpio.c    |    2 +-
 drivers/mfd/jz4740-adc.c   |    2 +-
 drivers/mfd/pm8921-core.c  |    2 +-
 drivers/mfd/t7l66xb.c      |    2 +-
 drivers/mfd/tc6393xb.c     |    2 +-
 drivers/mfd/ucb1x00-core.c |    4 ++--
 8 files changed, 9 insertions(+), 9 deletions(-)

So long as you've build tested each of these files:

Quoted 113 lines
drivers/mfd/asic3.c +1 -1
index 977bd3a3eed0..6bf17842a3e4 100644
@@ -138,7 +138,7 @@ static void asic3_irq_flip_edge(struct asic3 *asic,
 	spin_unlock_irqrestore(&asic->lock, flags);
 }
 
-static void asic3_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void asic3_irq_demux(struct irq_desc *desc)
 {
 	struct asic3 *asic = irq_desc_get_handler_data(desc);
 	struct irq_data *data = irq_desc_get_irq_data(desc);
drivers/mfd/ezx-pcap.c +1 -1
index e5f4ffaa5414..ab83124d75f7 100644
@@ -205,7 +205,7 @@ static void pcap_isr_work(struct work_struct *work)
 	} while (gpio_get_value(pdata->gpio));
 }
 
-static void pcap_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void pcap_irq_handler(struct irq_desc *desc)
 {
 	struct pcap_chip *pcap = irq_desc_get_handler_data(desc);
 
drivers/mfd/htc-egpio.c +1 -1
index 49f39feca784..8a3264e35403 100644
@@ -98,7 +98,7 @@ static struct irq_chip egpio_muxed_chip = {
 	.irq_unmask	= egpio_unmask,
 };
 
-static void egpio_handler(unsigned int irq, struct irq_desc *desc)
+static void egpio_handler(struct irq_desc *desc)
 {
 	struct egpio_info *ei = irq_desc_get_handler_data(desc);
 	int irqpin;
drivers/mfd/jz4740-adc.c +1 -1
index b31c54e4ecb2..ec1cd2297ea4 100644
@@ -65,7 +65,7 @@ struct jz4740_adc {
 	spinlock_t lock;
 };
 
-static void jz4740_adc_irq_demux(unsigned int irq, struct irq_desc *desc)
+static void jz4740_adc_irq_demux(struct irq_desc *desc)
 {
 	struct irq_chip_generic *gc = irq_desc_get_handler_data(desc);
 	uint8_t status;
drivers/mfd/pm8921-core.c +1 -1
index 5a92646a2ccb..87dd27e49a8b 100644
@@ -156,7 +156,7 @@ static int pm8xxx_irq_master_handler(struct pm_irq_chip *chip, int master)
 	return ret;
 }
 
-static void pm8xxx_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void pm8xxx_irq_handler(struct irq_desc *desc)
 {
 	struct pm_irq_chip *chip = irq_desc_get_handler_data(desc);
 	struct irq_chip *irq_chip = irq_desc_get_chip(desc);
drivers/mfd/t7l66xb.c +1 -1
index b752ca2be549..55ade59303b1 100644
@@ -185,7 +185,7 @@ static struct mfd_cell t7l66xb_cells[] = {
 /*--------------------------------------------------------------------------*/
 
 /* Handle the T7L66XB interrupt mux */
-static void t7l66xb_irq(unsigned int irq, struct irq_desc *desc)
+static void t7l66xb_irq(struct irq_desc *desc)
 {
 	struct t7l66xb *t7l66xb = irq_desc_get_handler_data(desc);
 	unsigned int isr;
drivers/mfd/tc6393xb.c +1 -1
index d21253a51cff..e22722cd667c 100644
@@ -523,7 +523,7 @@ static int tc6393xb_register_gpio(struct tc6393xb *tc6393xb, int gpio_base)
 /*--------------------------------------------------------------------------*/
 
 static void
-tc6393xb_irq(unsigned int irq, struct irq_desc *desc)
+tc6393xb_irq(struct irq_desc *desc)
 {
 	struct tc6393xb *tc6393xb = irq_desc_get_handler_data(desc);
 	unsigned int isr;
drivers/mfd/ucb1x00-core.c +2 -2
index 58ea9fdd3a15..2f8f922a34de 100644
@@ -282,7 +282,7 @@ void ucb1x00_adc_disable(struct ucb1x00 *ucb)
  * SIBCLK to talk to the chip.  We leave the clock running until
  * we have finished processing all interrupts from the chip.
  */
-static void ucb1x00_irq(unsigned int irq, struct irq_desc *desc)
+static void ucb1x00_irq(struct irq_desc *desc)
 {
 	struct ucb1x00 *ucb = irq_desc_get_handler_data(desc);
 	unsigned int isr, i;
@@ -292,7 +292,7 @@ static void ucb1x00_irq(unsigned int irq, struct irq_desc *desc)
 	ucb1x00_reg_write(ucb, UCB_IE_CLEAR, isr);
 	ucb1x00_reg_write(ucb, UCB_IE_CLEAR, 0);
 
-	for (i = 0; i < 16 && isr; i++, isr >>= 1, irq++)
+	for (i = 0; i < 16 && isr; i++, isr >>= 1)
 		if (isr & 1)
 			generic_handle_irq(ucb->irq_base + i);
 	ucb1x00_disable(ucb);
Signature · 8 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#66 lore raw

RFC 25/25 genirq: Kill the first parameter 'irq' of irq_flow_handler_t

In reply to Jiang Liu

Now most IRQ flow handlers make no use of the first parameter 'irq'. And for those who do make use of 'irq', we could easily get the irq number through irq_desc->irq_data->irq. So kill the first parameter 'irq' of irq_flow_handler_t.

To ease review, I have split the changes into several parts, though they should be merge as one to support bisecting.

---
 drivers/dma/ipu/ipu_irq.c       |    6 ++++--
 drivers/gpu/ipu-v3/ipu-common.c |    4 ++--
 drivers/pci/host/pci-keystone.c |    7 ++++---
 drivers/spmi/spmi-pmic-arb.c    |    2 +-
 4 files changed, 11 insertions(+), 8 deletions(-)
drivers/dma/ipu/ipu_irq.c +4 -2
index 0e12af37fe2f..edd12278dc3e 100644
@@ -266,8 +266,9 @@ int ipu_irq_unmap(unsigned int source)
 }
 
 /* Chained IRQ handler for IPU error interrupt */
-static void ipu_irq_err(unsigned int irq, struct irq_desc *desc)
+static void ipu_irq_err(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_to_irq(desc);
 	struct ipu *ipu = irq_desc_get_handler_data(desc);
 	u32 status;
 	int i, line;
@@ -307,8 +308,9 @@ static void ipu_irq_err(unsigned int irq, struct irq_desc *desc)
 }
 
 /* Chained IRQ handler for IPU function interrupt */
-static void ipu_irq_fn(unsigned int irq, struct irq_desc *desc)
+static void ipu_irq_fn(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_to_irq(desc);
 	struct ipu *ipu = irq_desc_get_handler_data(desc);
 	u32 status;
 	int i, line;
drivers/gpu/ipu-v3/ipu-common.c +2 -2
index 7022825b7a2c..1125b03c36af 100644
@@ -912,7 +912,7 @@ static void ipu_irq_handle(struct ipu_soc *ipu, const int *regs, int num_regs)
 	}
 }
 
-static void ipu_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void ipu_irq_handler(struct irq_desc *desc)
 {
 	struct ipu_soc *ipu = irq_desc_get_handler_data(desc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
@@ -925,7 +925,7 @@ static void ipu_irq_handler(unsigned int irq, struct irq_desc *desc)
 	chained_irq_exit(chip, desc);
 }
 
-static void ipu_err_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void ipu_err_irq_handler(struct irq_desc *desc)
 {
 	struct ipu_soc *ipu = irq_desc_get_handler_data(desc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
drivers/pci/host/pci-keystone.c +4 -3
index 75333b0c4f0a..659a73da372c 100644
@@ -112,8 +112,9 @@ static int ks_pcie_establish_link(struct keystone_pcie *ks_pcie)
 	return 0;
 }
 
-static void ks_pcie_msi_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void ks_pcie_msi_irq_handler(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_to_irq(desc);
 	struct keystone_pcie *ks_pcie = irq_desc_get_handler_data(desc);
 	u32 offset = irq - ks_pcie->msi_host_irqs[0];
 	struct pcie_port *pp = &ks_pcie->pp;
@@ -133,14 +134,14 @@ static void ks_pcie_msi_irq_handler(unsigned int irq, struct irq_desc *desc)
 
 /**
  * ks_pcie_legacy_irq_handler() - Handle legacy interrupt
- * @irq: IRQ line for legacy interrupts
  * @desc: Pointer to irq descriptor
  *
  * Traverse through pending legacy interrupts and invoke handler for each. Also
  * takes care of interrupt controller level mask/ack operation.
  */
-static void ks_pcie_legacy_irq_handler(unsigned int irq, struct irq_desc *desc)
+static void ks_pcie_legacy_irq_handler(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_to_irq(desc);
 	struct keystone_pcie *ks_pcie = irq_desc_get_handler_data(desc);
 	struct pcie_port *pp = &ks_pcie->pp;
 	u32 irq_offset = irq - ks_pcie->legacy_host_irqs[0];
drivers/spmi/spmi-pmic-arb.c +1 -1
index b32cb0a813cb..d7e7846917ae 100644
@@ -451,7 +451,7 @@ static void periph_interrupt(struct spmi_pmic_arb_dev *pa, u8 apid)
 	}
 }
 
-static void pmic_arb_chained_irq(unsigned int irq, struct irq_desc *desc)
+static void pmic_arb_chained_irq(struct irq_desc *desc)
 {
 	struct spmi_pmic_arb_dev *pa = irq_desc_get_handler_data(desc);
 	struct irq_chip *chip = irq_desc_get_chip(desc);
Signature · 1 line
1.7.10.4
#67 lore raw

Re: [RFC v1 25/25] genirq: Kill the first parameter 'irq' of irq_flow_handler_t

drivers/dma/ipu/ipu_irq.c int ipu_irq_unmap(unsigned int source) · line 271

Quoted 5 lines · Jiang Liu

/* Chained IRQ handler for IPU error interrupt */

drivers/dma/ipu/ipu_irq.c +2 -1
-static void ipu_irq_err(unsigned int irq, struct irq_desc *desc)
+static void ipu_irq_err(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_to_irq(desc);

Why initializing? It's overwritten in the loop.

drivers/dma/ipu/ipu_irq.c static void ipu_irq_err(unsigned int irq, struct irq_desc *desc) · line 313

Quoted 5 lines

/* Chained IRQ handler for IPU function interrupt */

drivers/dma/ipu/ipu_irq.c +2 -1
-static void ipu_irq_fn(unsigned int irq, struct irq_desc *desc)
+static void ipu_irq_fn(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_to_irq(desc);

Ditto.

Thanks,

tglx

author
#68 lore raw

Re: [RFC v1 25/25] genirq: Kill the first parameter 'irq' of irq_flow_handler_t

Quoted 8 lines · Thomas Gleixner

drivers/dma/ipu/ipu_irq.c int ipu_irq_unmap(unsigned int source) · line 271

Quoted 5 lines · Jiang Liu

/* Chained IRQ handler for IPU error interrupt */

drivers/dma/ipu/ipu_irq.c +2 -1
-static void ipu_irq_err(unsigned int irq, struct irq_desc *desc)
+static void ipu_irq_err(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_to_irq(desc);

Why initializing? It's overwritten in the loop.

Hi Thomas,

I'm not familiar with the hardware, but if src2map() returns 0 on the first call, we need to initialize irq. Otherwise generic_handle_irq(irq) will use random value on the first call.
---------------------------------------------------------

                        map = src2map(32 * i + line);
                        if (map)
                                irq = map->irq;

---------------------------------------------------------
Thanks!
Gerry

Quoted 13 lines

drivers/dma/ipu/ipu_irq.c static void ipu_irq_err(unsigned int irq, struct irq_desc *desc) · line 313

Quoted 6 lines

/* Chained IRQ handler for IPU function interrupt */

drivers/dma/ipu/ipu_irq.c +2 -1
-static void ipu_irq_fn(unsigned int irq, struct irq_desc *desc)
+static void ipu_irq_fn(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_to_irq(desc);

Ditto.

Thanks,

tglx

#69 lore raw

Re: [RFC v1 25/25] genirq: Kill the first parameter 'irq' of irq_flow_handler_t

Quoted 11 lines · Jiang Liu
Quoted 8 lines · Thomas Gleixner

drivers/dma/ipu/ipu_irq.c int ipu_irq_unmap(unsigned int source) · line 271

Quoted 5 lines · Jiang Liu

/* Chained IRQ handler for IPU error interrupt */

drivers/dma/ipu/ipu_irq.c +2 -1
-static void ipu_irq_err(unsigned int irq, struct irq_desc *desc)
+static void ipu_irq_err(struct irq_desc *desc)
 {
+	unsigned int irq = irq_desc_to_irq(desc);

Why initializing? It's overwritten in the loop.

Hi Thomas,

Quoted 7 lines

I'm not familiar with the hardware, but if src2map() returns 0 on the first call, we need to initialize irq. Otherwise generic_handle_irq(irq) will use random value on the first call.
---------------------------------------------------------

                        map = src2map(32 * i + line);
                        if (map)
                                irq = map->irq;

You omitted the following code:

                        raw_spin_unlock(&bank_lock);

                        if (!map) {
                                pr_err("IPU: Interrupt on unmapped source %u bank %d\n",
                                       line, i);
                                continue;
			}

So you it does not use irq if map is 0.

Thanks,

tglx

#70 lore raw
In reply to Jiang Liu
Quoted 4 lines · Jiang Liu

genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t

Quoted 8 lines

genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t

Those kinds of identical titles are not acceptable.

Thanks,

Ingo

author
#71 lore raw
Quoted 16 lines · Ingo Molnar
Quoted 4 lines · Jiang Liu

genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t

Quoted 8 lines

genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t
genirq: Kill the first parameter 'irq' of irq_flow_handler_t

Quoted 1 line

Those kinds of identical titles are not acceptable.

Hi Ingo,
Those patches with identical titles will be merged into one
when ready for merging, they are split for review only. Thanks!
Gerry

Quoted 5 lines

Thanks,

Ingo