From: Boaz Harrosh <bharrosh@panasas.com>
To: Jeff Garzik <jeff@garzik.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
akpm@linux-foundation.org, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] SCSI/gdth: kill unneeded 'irq' argument
Date: Mon, 29 Oct 2007 11:22:27 +0200 [thread overview]
Message-ID: <4725A653.8070404@panasas.com> (raw)
In-Reply-To: <bdd7a2edf0951f98b9dde3e3465e4fd9263db79e.1193390975.git.jeff@garzik.org>
On Fri, Oct 26 2007 at 11:40 +0200, Jeff Garzik <jeff@garzik.org> wrote:
> Neither gdth_get_status() nor __gdth_interrupt() need their 'irq'
> argument, so remove it.
>
> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
> ---
> drivers/scsi/gdth.c | 21 +++++++++------------
> 1 files changed, 9 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/scsi/gdth.c b/drivers/scsi/gdth.c
> index b253b8c..65c21b1 100644
> --- a/drivers/scsi/gdth.c
> +++ b/drivers/scsi/gdth.c
> @@ -141,7 +141,7 @@
> static void gdth_delay(int milliseconds);
> static void gdth_eval_mapping(ulong32 size, ulong32 *cyls, int *heads, int *secs);
> static irqreturn_t gdth_interrupt(int irq, void *dev_id);
> -static irqreturn_t __gdth_interrupt(gdth_ha_str *ha, int irq,
> +static irqreturn_t __gdth_interrupt(gdth_ha_str *ha,
> int gdth_from_wait, int* pIndex);
> static int gdth_sync_event(gdth_ha_str *ha, int service, unchar index,
> Scsi_Cmnd *scp);
> @@ -165,7 +165,6 @@ static int gdth_internal_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp);
> static int gdth_fill_cache_cmd(gdth_ha_str *ha, Scsi_Cmnd *scp, ushort hdrive);
>
> static void gdth_enable_int(gdth_ha_str *ha);
> -static unchar gdth_get_status(gdth_ha_str *ha, int irq);
> static int gdth_test_busy(gdth_ha_str *ha);
> static int gdth_get_cmd_index(gdth_ha_str *ha);
> static void gdth_release_event(gdth_ha_str *ha);
> @@ -1334,14 +1333,12 @@ static void __init gdth_enable_int(gdth_ha_str *ha)
> }
>
> /* return IStatus if interrupt was from this card else 0 */
> -static unchar gdth_get_status(gdth_ha_str *ha, int irq)
> +static unchar gdth_get_status(gdth_ha_str *ha)
> {
> unchar IStatus = 0;
>
> - TRACE(("gdth_get_status() irq %d ctr_count %d\n", irq, gdth_ctr_count));
> + TRACE(("gdth_get_status() irq %d ctr_count %d\n", ha->irq, gdth_ctr_count));
>
> - if (ha->irq != (unchar)irq) /* check IRQ */
> - return false;
> if (ha->type == GDT_EISA)
> IStatus = inb((ushort)ha->bmic + EDOORREG);
> else if (ha->type == GDT_ISA)
> @@ -1523,7 +1520,7 @@ static int gdth_wait(gdth_ha_str *ha, int index, ulong32 time)
> return 1; /* no wait required */
>
> do {
> - __gdth_interrupt(ha, (int)ha->irq, true, &wait_index);
> + __gdth_interrupt(ha, true, &wait_index);
> if (wait_index == index) {
> answer_found = TRUE;
> break;
> @@ -3036,7 +3033,7 @@ static void gdth_clear_events(void)
>
> /* SCSI interface functions */
>
> -static irqreturn_t __gdth_interrupt(gdth_ha_str *ha, int irq,
> +static irqreturn_t __gdth_interrupt(gdth_ha_str *ha,
> int gdth_from_wait, int* pIndex)
> {
> gdt6m_dpram_str __iomem *dp6m_ptr = NULL;
> @@ -3054,7 +3051,7 @@ static irqreturn_t __gdth_interrupt(gdth_ha_str *ha, int irq,
> int act_int_coal = 0;
> #endif
>
> - TRACE(("gdth_interrupt() IRQ %d\n",irq));
> + TRACE(("gdth_interrupt() IRQ %d\n", ha->irq));
>
> /* if polling and not from gdth_wait() -> return */
> if (gdth_polling) {
> @@ -3067,7 +3064,7 @@ static irqreturn_t __gdth_interrupt(gdth_ha_str *ha, int irq,
> spin_lock_irqsave(&ha->smp_lock, flags);
>
> /* search controller */
> - if (0 == (IStatus = gdth_get_status(ha, irq))) {
> + if (0 == (IStatus = gdth_get_status(ha))) {
> /* spurious interrupt */
> if (!gdth_polling)
> spin_unlock_irqrestore(&ha->smp_lock, flags);
> @@ -3294,9 +3291,9 @@ static irqreturn_t __gdth_interrupt(gdth_ha_str *ha, int irq,
>
> static irqreturn_t gdth_interrupt(int irq, void *dev_id)
> {
> - gdth_ha_str *ha = (gdth_ha_str *)dev_id;
> + gdth_ha_str *ha = dev_id;
>
> - return __gdth_interrupt(ha, irq, false, NULL);
> + return __gdth_interrupt(ha, false, NULL);
> }
>
> static int gdth_sync_event(gdth_ha_str *ha, int service, unchar index,
ACK
I've done the last heavy lifting of gdth_interrupt. And I second this patch.
the irq was just redundant information to the ha pointer. Good riddance.
Boaz
next prev parent reply other threads:[~2007-10-29 9:22 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-26 9:40 [PATCH] Remove pointless casts from void pointers, Jeff Garzik
2007-10-26 9:40 ` Jeff Garzik
2007-10-26 9:40 ` [PATCH] Remove always-true tests in irq handlers Jeff Garzik
2007-10-26 9:40 ` Jeff Garzik
2007-10-26 12:02 ` Ralf Baechle
2007-10-26 12:02 ` Ralf Baechle
2007-10-26 9:40 ` [PATCH] ARM: Misc minor interrupt handler cleanups Jeff Garzik
2007-10-26 21:56 ` Lennert Buytenhek
2007-10-26 9:40 ` [PATCH] IA64, PPC, SPARC: minor irq " Jeff Garzik
2007-10-26 9:40 ` Jeff Garzik
2007-10-26 9:44 ` Kumar Gala
2007-10-26 9:44 ` Kumar Gala
2007-10-26 9:49 ` Jeff Garzik
2007-10-26 9:49 ` Jeff Garzik
2007-10-26 14:55 ` Kumar Gala
2007-10-26 14:55 ` Kumar Gala
2007-10-26 9:40 ` [PATCH] media/video/planb: fix obvious interrupt handling bugs Jeff Garzik
2007-10-26 9:40 ` [PATCH] drivers/net/irda/au1k_ir: fix obvious irq handler bugs Jeff Garzik
2007-10-26 9:40 ` [PATCH] SCSI/gdth: kill unneeded 'irq' argument Jeff Garzik
2007-10-29 9:22 ` Boaz Harrosh [this message]
2007-10-26 9:40 ` [PATCH] SCSI/sym53c416: kill pointless irq handler loop and test Jeff Garzik
2007-10-26 9:40 ` [PATCH] NETDRVR, USB: declance, lp486e, s3c2410_udc: minor irq handler cleanups Jeff Garzik
2007-10-26 12:24 ` [PATCH] Remove pointless casts from void pointers, John W. Linville
2007-10-26 13:38 ` Dmitry Torokhov
2007-10-26 14:46 ` Josh Boyer
[not found] ` <9799624f63e093aa915947aea8fb1b8a5df959a1.1193390973.git.jeff-o2qLIJkoznsdnm+yROfE0A@public.gmane.org>
2007-10-26 14:55 ` Holger Schurig
2007-10-26 14:55 ` Holger Schurig
2007-10-26 21:58 ` Lennert Buytenhek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4725A653.8070404@panasas.com \
--to=bharrosh@panasas.com \
--cc=akpm@linux-foundation.org \
--cc=jeff@garzik.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.