linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH #upstream-fixes 1/2] libata: cleanup ata_sff_interrupt()
@ 2010-01-14  7:50 Tejun Heo
  2010-01-14  7:53 ` [PATCH #upstream-fixes 2/2] libata: implement spurious irq handling for SFF and apply it to piix Tejun Heo
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Tejun Heo @ 2010-01-14  7:50 UTC (permalink / raw)
  To: Jeff Garzik, linux-ide@vger.kernel.org, Alan Cox, Hans Werner,
	Sergei Shtylyov <sshtylyov>

host->ports[i] is never NULL if i < host->n_ports and non-NULL return
from ata_qc_from_tag() guarantees that the returned qc is active.
Drop unnecessary tests.

Signed-off-by: Tejun Heo <tj@kernel.org>
---
 drivers/ata/libata-sff.c |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

Index: ata/drivers/ata/libata-sff.c
===================================================================
--- ata.orig/drivers/ata/libata-sff.c
+++ ata/drivers/ata/libata-sff.c
@@ -1767,18 +1767,15 @@ irqreturn_t ata_sff_interrupt(int irq, v
 	spin_lock_irqsave(&host->lock, flags);
 
 	for (i = 0; i < host->n_ports; i++) {
-		struct ata_port *ap;
+		struct ata_port *ap = host->ports[i];
+		struct ata_queued_cmd *qc;
 
-		ap = host->ports[i];
-		if (ap &&
-		    !(ap->flags & ATA_FLAG_DISABLED)) {
-			struct ata_queued_cmd *qc;
+		if (unlikely(ap->flags & ATA_FLAG_DISABLED))
+			continue;
 
-			qc = ata_qc_from_tag(ap, ap->link.active_tag);
-			if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING)) &&
-			    (qc->flags & ATA_QCFLAG_ACTIVE))
-				handled |= ata_sff_host_intr(ap, qc);
-		}
+		qc = ata_qc_from_tag(ap, ap->link.active_tag);
+		if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING)))
+			handled |= ata_sff_host_intr(ap, qc);
 	}
 
 	spin_unlock_irqrestore(&host->lock, flags);

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-01-15 21:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-14  7:50 [PATCH #upstream-fixes 1/2] libata: cleanup ata_sff_interrupt() Tejun Heo
2010-01-14  7:53 ` [PATCH #upstream-fixes 2/2] libata: implement spurious irq handling for SFF and apply it to piix Tejun Heo
2010-01-14 12:42   ` Sergei Shtylyov
2010-01-15  3:39     ` Tejun Heo
2010-01-15 10:23       ` Sergei Shtylyov
2010-01-15 21:45         ` Tejun Heo
2010-01-14 10:20 ` [PATCH #upstream-fixes 1/2] libata: cleanup ata_sff_interrupt() Sergei Shtylyov
2010-01-15  3:36   ` Tejun Heo
2010-01-14 17:38 ` Jeff Garzik
2010-01-15  3:33   ` Tejun Heo

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).