From patchwork Tue Jan 19 01:46:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 43162 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 64878B7C09 for ; Tue, 19 Jan 2010 12:41:02 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752305Ab0ASBk5 (ORCPT ); Mon, 18 Jan 2010 20:40:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752257Ab0ASBk5 (ORCPT ); Mon, 18 Jan 2010 20:40:57 -0500 Received: from hera.kernel.org ([140.211.167.34]:35858 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751930Ab0ASBk4 (ORCPT ); Mon, 18 Jan 2010 20:40:56 -0500 Received: from htj.dyndns.org (localhost [127.0.0.1]) by hera.kernel.org (8.14.3/8.14.3) with ESMTP id o0J1eQ4a004223 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 19 Jan 2010 01:40:30 GMT X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.95.2 at hera.kernel.org Received: from [127.0.0.2] (htj.dyndns.org [127.0.0.2]) by htj.dyndns.org (Postfix) with ESMTPSA id CF9AA1005AA4D; Tue, 19 Jan 2010 10:46:32 +0900 (KST) Message-ID: <4B550EF8.1000009@kernel.org> Date: Tue, 19 Jan 2010 10:46:32 +0900 From: Tejun Heo User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091130 SUSE/3.0.0-1.1.1 Thunderbird/3.0 MIME-Version: 1.0 To: Jeff Garzik , "linux-ide@vger.kernel.org" , Alan Cox , Hans Werner , Sergei Shtylyov Subject: [PATCH #upstream 1/2] libata: cleanup ata_sff_interrupt() X-Enigmail-Version: 1.0 X-Spam-Status: No, score=0.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DATE_IN_FUTURE_96_XX,FH_DATE_PAST_20XX autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on hera.kernel.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (hera.kernel.org [127.0.0.1]); Tue, 19 Jan 2010 01:40:30 +0000 (UTC) Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org 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. Superflous () dropped as suggested by Sergei. Signed-off-by: Tejun Heo Cc: Sergei Shtylyov --- drivers/ata/libata-sff.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);