Skip to content

Commit

Permalink
sata_sil24: sil24_interrupt() micro-optimisation
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Mikael Pettersson authored and Jeff Garzik committed Jul 9, 2007
1 parent 5f45bc5 commit 825cd6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ata/sata_sil24.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ static irqreturn_t sil24_interrupt(int irq, void *dev_instance)
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
Expand Down

0 comments on commit 825cd6d

Please sign in to comment.