login
Header Space

 
 

[PATCH 07/15] [SCSI] aha1542: minor irq handler cleanups

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-scsi@...>
Cc: Andrew Morton <akpm@...>, LKML <linux-kernel@...>
Date: Friday, April 18, 2008 - 7:22 pm

- where the 'irq' function argument is known never to be used, rename
  it to 'dummy' to make this more obvious

- replace per-irq lookup functions and tables with a direct reference
  to data object obtained via 'dev_id' function argument, passed from
  request_irq()

This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
 drivers/scsi/aha1542.c |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 5a1471c..1375915 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -153,8 +153,6 @@ struct aha1542_hostdata {
 
 #define HOSTDATA(host) ((struct aha1542_hostdata *) &host->hostdata)
 
-static struct Scsi_Host *aha_host[7];	/* One for each IRQ level (9-15) */
-
 static DEFINE_SPINLOCK(aha1542_lock);
 
 
@@ -163,8 +161,7 @@ static DEFINE_SPINLOCK(aha1542_lock);
 
 static void setup_mailboxes(int base_io, struct Scsi_Host *shpnt);
 static int aha1542_restart(struct Scsi_Host *shost);
-static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id);
-static irqreturn_t do_aha1542_intr_handle(int irq, void *dev_id);
+static void aha1542_intr_handle(struct Scsi_Host *shost);
 
 #define aha1542_intr_reset(base)  outb(IRST, CONTROL(base))
 
@@ -404,23 +401,19 @@ fail:
 }
 
 /* A quick wrapper for do_aha1542_intr_handle to grab the spin lock */
-static irqreturn_t do_aha1542_intr_handle(int irq, void *dev_id)
+static irqreturn_t do_aha1542_intr_handle(int dummy, void *dev_id)
 {
 	unsigned long flags;
-	struct Scsi_Host *shost;
-
-	shost = aha_host[irq - 9];
-	if (!shost)
-		panic("Splunge!");
+	struct Scsi_Host *shost = dev_id;
 
 	spin_lock_irqsave(shost->host_lock, flags);
-	aha1542_intr_handle(shost, dev_id);
+	aha1542_intr_handle(shost);
 	spin_unlock_irqrestore(shost->host_lock, flags);
 	return IRQ_HANDLED;
 }
 
 /* A "high" level interrupt handler */
-static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id)
+static void aha1542_intr_handle(struct Scsi_Host *shost)
 {
 	void (*my_done) (Scsi_Cmnd *) = NULL;
 	int errstatus, mbi, mbo, mbistatus;
@@ -1197,7 +1190,8 @@ fail:
 
 			DEB(printk("aha1542_detect: enable interrupt channel %d\n", irq_level));
 			spin_lock_irqsave(&aha1542_lock, flags);
-			if (request_irq(irq_level, do_aha1542_intr_handle, 0, "aha1542", NULL)) {
+			if (request_irq(irq_level, do_aha1542_intr_handle, 0,
+					"aha1542", shpnt)) {
 				printk(KERN_ERR "Unable to allocate IRQ for adaptec controller.\n");
 				spin_unlock_irqrestore(&aha1542_lock, flags);
 				goto unregister;
@@ -1214,7 +1208,7 @@ fail:
 					enable_dma(dma_chan);
 				}
 			}
-			aha_host[irq_level - 9] = shpnt;
+
 			shpnt->this_id = scsi_id;
 			shpnt->unique_id = base_io;
 			shpnt->io_port = base_io;
-- 
1.5.4.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 01/15] ARM minor irq handler cleanups, Jeff Garzik, (Fri Apr 18, 7:22 pm)
Re: [PATCH 01/15] ARM minor irq handler cleanups, Russell King, (Sat Apr 19, 4:17 am)
Re: [PATCH 01/15] ARM minor irq handler cleanups, Jeff Garzik, (Sat Apr 19, 4:28 am)
Re: [PATCH 01/15] ARM minor irq handler cleanups, Lennert Buytenhek, (Fri Apr 18, 7:29 pm)
Re: [PATCH 01/15] ARM minor irq handler cleanups, Jeff Garzik, (Fri Apr 18, 8:25 pm)
Re: [PATCH 01/15] ARM minor irq handler cleanups, Lennert Buytenhek, (Sat Apr 19, 12:14 pm)
Re: [PATCH 01/15] ARM minor irq handler cleanups, Andrew Morton, (Fri Apr 18, 7:44 pm)
Re: [PATCH 01/15] ARM minor irq handler cleanups, Jeff Garzik, (Fri Apr 18, 8:21 pm)
Re: [PATCH 01/15] ARM minor irq handler cleanups, Andrew Morton, (Fri Apr 18, 9:17 pm)
Re: [PATCH 01/15] ARM minor irq handler cleanups, Jeff Garzik, (Sun Apr 20, 6:17 pm)
Re: [PATCH 01/15] ARM minor irq handler cleanups, Russell King, (Sun Apr 20, 6:40 pm)
Re: [PATCH 01/15] ARM minor irq handler cleanups, Jeff Garzik, (Sun Apr 20, 6:49 pm)
[PATCH 14/15] Canonicalize several irq handlers., Jeff Garzik, (Fri Apr 18, 7:23 pm)
[PATCH 13/15] [X86] standard vm86 irq handler, Jeff Garzik, (Fri Apr 18, 7:23 pm)
Re: [PATCH 13/15] [X86] standard vm86 irq handler, Ingo Molnar, (Mon Apr 21, 9:52 am)
[PATCH 11/15] [RTC] minor irq handler cleanups, Jeff Garzik, (Fri Apr 18, 7:23 pm)
[PATCH 10/15] [IA64] minor irq handler cleanups, Jeff Garzik, (Fri Apr 18, 7:22 pm)
[PATCH 08/15] [ISDN] minor irq handler cleanups, Jeff Garzik, (Fri Apr 18, 7:22 pm)
[PATCH 07/15] [SCSI] aha1542: minor irq handler cleanups, Jeff Garzik, (Fri Apr 18, 7:22 pm)
[PATCH 05/15] drivers/char: minor irq handler cleanups, Jeff Garzik, (Fri Apr 18, 7:22 pm)
Re: [PATCH 05/15] drivers/char: minor irq handler cleanups, Benjamin Herrenschmidt, (Tue Apr 22, 4:05 am)
Re: [PATCH 05/15] drivers/char: minor irq handler cleanups, Benjamin Herrenschmidt, (Tue Apr 22, 6:46 am)
[PATCH 06/15] [SCSI] minor irq handler cleanups, Jeff Garzik, (Fri Apr 18, 7:22 pm)
[PATCH 04/15] [PPC] minor irq handler cleanups, Jeff Garzik, (Fri Apr 18, 7:22 pm)
Re: [PATCH 04/15] [PPC] minor irq handler cleanups, Kumar Gala, (Sat Apr 19, 10:57 am)
[PATCH 03/15] [BLACKFIN] minor irq handler cleanups, Jeff Garzik, (Fri Apr 18, 7:22 pm)
[PATCH 02/15] [SPARC] minor irq handler cleanups, Jeff Garzik, (Fri Apr 18, 7:22 pm)
Re: [PATCH 02/15] [SPARC] minor irq handler cleanups, David Miller, (Fri Apr 18, 7:33 pm)
speck-geostationary