* [patch 0/2] dma: ipu: Preparation for API change and consolidation
@ 2015-08-01 7:06 Thomas Gleixner
2015-08-01 7:06 ` [patch 1/2] dma: ipu: Prepare irq handlers for irq argument removal Thomas Gleixner
2015-08-01 7:06 ` [patch 2/2] dma: ipu: Consolidate duplicated irq handlers Thomas Gleixner
0 siblings, 2 replies; 4+ messages in thread
From: Thomas Gleixner @ 2015-08-01 7:06 UTC (permalink / raw)
To: LKML
The first patch prepares the interrupt handlers for removal of the irq
argument.
While doing that I noticed that the handler functions are
identical. Consolidate them.
Thanks,
tglx
^ permalink raw reply [flat|nested] 4+ messages in thread
* [patch 2/2] dma: ipu: Consolidate duplicated irq handlers
2015-08-01 7:06 [patch 0/2] dma: ipu: Preparation for API change and consolidation Thomas Gleixner
2015-08-01 7:06 ` [patch 1/2] dma: ipu: Prepare irq handlers for irq argument removal Thomas Gleixner
@ 2015-08-01 7:06 ` Thomas Gleixner
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2015-08-01 7:06 UTC (permalink / raw)
To: LKML; +Cc: Vinod Koul, Dan Williams, dmaengine
[-- Attachment #1: dma--ipu--Consolidate-duplicated-irq-handlers --]
[-- Type: text/plain, Size: 2475 bytes --]
The functions irq_irq_err and ipu_irq_fn are identical plus/minus the
comments. Remove one.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: dmaengine@vger.kernel.org
---
drivers/dma/ipu/ipu_irq.c | 46 ++++------------------------------------------
1 file changed, 4 insertions(+), 42 deletions(-)
Index: linux-next/drivers/dma/ipu/ipu_irq.c
===================================================================
--- linux-next.orig/drivers/dma/ipu/ipu_irq.c
+++ linux-next/drivers/dma/ipu/ipu_irq.c
@@ -265,8 +265,8 @@ int ipu_irq_unmap(unsigned int source)
return ret;
}
-/* Chained IRQ handler for IPU error interrupt */
-static void ipu_irq_err(unsigned int __irq, struct irq_desc *desc)
+/* Chained IRQ handler for IPU function and error interrupt */
+static void ipu_irq_handler(unsigned int __irq, struct irq_desc *desc)
{
struct ipu *ipu = irq_desc_get_handler_data(desc);
u32 status;
@@ -307,44 +307,6 @@ static void ipu_irq_err(unsigned int __i
}
}
-/* Chained IRQ handler for IPU function interrupt */
-static void ipu_irq_fn(unsigned int __irq, struct irq_desc *desc)
-{
- struct ipu *ipu = irq_desc_get_handler_data(desc);
- u32 status;
- int i, line;
-
- for (i = 0; i < IPU_IRQ_NR_FN_BANKS; i++) {
- struct ipu_irq_bank *bank = irq_bank + i;
-
- raw_spin_lock(&bank_lock);
- status = ipu_read_reg(ipu, bank->status);
- /* Not clearing all interrupts, see above */
- status &= ipu_read_reg(ipu, bank->control);
- raw_spin_unlock(&bank_lock);
- while ((line = ffs(status))) {
- struct ipu_irq_map *map;
- unsigned int irq;
-
- line--;
- status &= ~(1UL << line);
-
- raw_spin_lock(&bank_lock);
- map = src2map(32 * i + line);
- if (map)
- irq = map->irq;
- raw_spin_unlock(&bank_lock);
-
- if (!map) {
- pr_err("IPU: Interrupt on unmapped source %u bank %d\n",
- line, i);
- continue;
- }
- generic_handle_irq(irq);
- }
- }
-}
-
static struct irq_chip ipu_irq_chip = {
.name = "ipu_irq",
.irq_ack = ipu_irq_ack,
@@ -384,9 +346,9 @@ int __init ipu_irq_attach_irq(struct ipu
#endif
}
- irq_set_chained_handler_and_data(ipu->irq_fn, ipu_irq_fn, ipu);
+ irq_set_chained_handler_and_data(ipu->irq_fn, ipu_irq_handler, ipu);
- irq_set_chained_handler_and_data(ipu->irq_err, ipu_irq_err, ipu);
+ irq_set_chained_handler_and_data(ipu->irq_err, ipu_irq_handler, ipu);
ipu->irq_base = irq_base;
^ permalink raw reply [flat|nested] 4+ messages in thread
* [patch 1/2] dma: ipu: Prepare irq handlers for irq argument removal
2015-08-01 7:06 [patch 0/2] dma: ipu: Preparation for API change and consolidation Thomas Gleixner
@ 2015-08-01 7:06 ` Thomas Gleixner
2015-08-05 5:38 ` Vinod Koul
2015-08-01 7:06 ` [patch 2/2] dma: ipu: Consolidate duplicated irq handlers Thomas Gleixner
1 sibling, 1 reply; 4+ messages in thread
From: Thomas Gleixner @ 2015-08-01 7:06 UTC (permalink / raw)
To: LKML; +Cc: Julia Lawall, Vinod Koul, Dan Williams, dmaengine
[-- Attachment #1: dma--ipu--Prepare-irq-handlers-for-irq-argument-removal --]
[-- Type: text/plain, Size: 1876 bytes --]
The irq argument of most interrupt flow handlers is unused or merily
used instead of a local variable. The handlers which need the irq
argument can retrieve the irq number from the irq descriptor.
Search and update was done with coccinelle and the invaluable help of
Julia Lawall.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: dmaengine@vger.kernel.org
---
drivers/dma/ipu/ipu_irq.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Index: linux-next/drivers/dma/ipu/ipu_irq.c
===================================================================
--- linux-next.orig/drivers/dma/ipu/ipu_irq.c
+++ linux-next/drivers/dma/ipu/ipu_irq.c
@@ -266,7 +266,7 @@ 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(unsigned int __irq, struct irq_desc *desc)
{
struct ipu *ipu = irq_desc_get_handler_data(desc);
u32 status;
@@ -286,6 +286,7 @@ static void ipu_irq_err(unsigned int irq
raw_spin_unlock(&bank_lock);
while ((line = ffs(status))) {
struct ipu_irq_map *map;
+ unsigned int irq;
line--;
status &= ~(1UL << line);
@@ -307,7 +308,7 @@ static void ipu_irq_err(unsigned int irq
}
/* Chained IRQ handler for IPU function interrupt */
-static void ipu_irq_fn(unsigned int irq, struct irq_desc *desc)
+static void ipu_irq_fn(unsigned int __irq, struct irq_desc *desc)
{
struct ipu *ipu = irq_desc_get_handler_data(desc);
u32 status;
@@ -323,6 +324,7 @@ static void ipu_irq_fn(unsigned int irq,
raw_spin_unlock(&bank_lock);
while ((line = ffs(status))) {
struct ipu_irq_map *map;
+ unsigned int irq;
line--;
status &= ~(1UL << line);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 1/2] dma: ipu: Prepare irq handlers for irq argument removal
2015-08-01 7:06 ` [patch 1/2] dma: ipu: Prepare irq handlers for irq argument removal Thomas Gleixner
@ 2015-08-05 5:38 ` Vinod Koul
0 siblings, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2015-08-05 5:38 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: LKML, Julia Lawall, Dan Williams, dmaengine
On Sat, Aug 01, 2015 at 07:06:58AM +0000, Thomas Gleixner wrote:
> The irq argument of most interrupt flow handlers is unused or merily
> used instead of a local variable. The handlers which need the irq
> argument can retrieve the irq number from the irq descriptor.
>
> Search and update was done with coccinelle and the invaluable help of
> Julia Lawall.
Applied both with fix in subsystem name
Thanks
--
~Vinod
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-08-05 5:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-01 7:06 [patch 0/2] dma: ipu: Preparation for API change and consolidation Thomas Gleixner
2015-08-01 7:06 ` [patch 1/2] dma: ipu: Prepare irq handlers for irq argument removal Thomas Gleixner
2015-08-05 5:38 ` Vinod Koul
2015-08-01 7:06 ` [patch 2/2] dma: ipu: Consolidate duplicated irq handlers Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox