* [PATCH 2.6.22-rc7] sata_sil24: sil24_interrupt() micro-optimisation
@ 2007-07-02 23:10 Mikael Pettersson
2007-07-03 14:17 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: Mikael Pettersson @ 2007-07-02 23:10 UTC (permalink / raw)
To: htejun; +Cc: Jeff Garzik, linux-ide
sil24_interrupt() loads host->ports[i] into a local variable,
validates it, and then loads the value again in the call to
sil24_host_intr(). This patch replaces the second load by a
reference to the local variable.
This is safe since no side-effects have occurred since the
initial load. It also improves readability since it makes
it clear that the parameter to sil24_host_intr() is the same
value which was just validated.
Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
--- linux-2.6.22-rc7/drivers/ata/sata_sil24.c.~1~ 2007-07-02 21:41:37.000000000 +0200
+++ linux-2.6.22-rc7/drivers/ata/sata_sil24.c 2007-07-02 23:28:57.000000000 +0200
@@ -888,7 +888,7 @@ static irqreturn_t sil24_interrupt(int i
if (status & (1 << i)) {
struct ata_port *ap = host->ports[i];
if (ap && !(ap->flags & ATA_FLAG_DISABLED)) {
- sil24_host_intr(host->ports[i]);
+ sil24_host_intr(ap);
handled++;
} else
printk(KERN_ERR DRV_NAME
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2.6.22-rc7] sata_sil24: sil24_interrupt() micro-optimisation
2007-07-02 23:10 [PATCH 2.6.22-rc7] sata_sil24: sil24_interrupt() micro-optimisation Mikael Pettersson
@ 2007-07-03 14:17 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2007-07-03 14:17 UTC (permalink / raw)
To: Mikael Pettersson; +Cc: htejun, linux-ide
Mikael Pettersson wrote:
> sil24_interrupt() loads host->ports[i] into a local variable,
> validates it, and then loads the value again in the call to
> sil24_host_intr(). This patch replaces the second load by a
> reference to the local variable.
>
> This is safe since no side-effects have occurred since the
> initial load. It also improves readability since it makes
> it clear that the parameter to sil24_host_intr() is the same
> value which was just validated.
>
> Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
applied
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-03 14:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-02 23:10 [PATCH 2.6.22-rc7] sata_sil24: sil24_interrupt() micro-optimisation Mikael Pettersson
2007-07-03 14:17 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).