From patchwork Mon Jun 16 07:58:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 4356721 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E7B629F26E for ; Mon, 16 Jun 2014 08:11:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16E3A2020E for ; Mon, 16 Jun 2014 08:11:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30F56201ED for ; Mon, 16 Jun 2014 08:11:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WwRoW-0002X1-05; Mon, 16 Jun 2014 07:58:48 +0000 Received: from mail-la0-f54.google.com ([209.85.215.54]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WwRoL-0002OV-VZ for linux-arm-kernel@lists.infradead.org; Mon, 16 Jun 2014 07:58:38 +0000 Received: by mail-la0-f54.google.com with SMTP id mc6so2218223lab.13 for ; Mon, 16 Jun 2014 00:58:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4zjJgiq4PyMKOLJr9ysTJOFvAvn7a+M+Kz37KWYDNjw=; b=Zdu/TnhogOkmynMZyQoKue7SV4k2bhJWjL4olIayOOH3vjlMudZgHwKFLGKMb/mkL0 mI229yHP4HAp+j+o4k5ZMhWiP1PQP7GmvwA5/c3nYw+TIBprBgrl+HOlqqSmeW244+Fm nVn2wO7S0tgEd5VXKmDgCGIMev9PuUZUjL/xihTcF/GVtxa2JtMJJNa567BXpjUzFzLD 5Zb6zNpJRO/LldHFjSpJMnS2V9oec8Vw20KsexbDvZ99Rm+us/bDuUZkO+KZ1mJ6RRjO lEr1vmhmAfOFOCOcuPbE0xPlGfVPHIazLLj/n4nKz/yOJw+Ijm9xPB3TSolDC6sigAA8 VBEw== X-Gm-Message-State: ALoCoQkpsJCalg2UYYdyvS15/RJwraF1l4utWgw1zrkd74RgpewTX9dQRmrFi+UHd4cTD67M0dVh X-Received: by 10.152.20.71 with SMTP id l7mr13303969lae.4.1402905491141; Mon, 16 Jun 2014 00:58:11 -0700 (PDT) Received: from linaro-ulf.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id yr11sm8023589lbb.5.2014.06.16.00.58.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Jun 2014 00:58:10 -0700 (PDT) From: Ulf Hansson To: linux-arm-kernel@lists.infradead.org, Russell King Subject: [PATCH 1/3] mmc: mmci: Remove redundant check of status for DATA irq Date: Mon, 16 Jun 2014 09:58:01 +0200 Message-Id: <1402905483-22567-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1402905483-22567-1-git-send-email-ulf.hansson@linaro.org> References: <1402905483-22567-1-git-send-email-ulf.hansson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140616_005838_228743_B36A6D4F X-CRM114-Status: GOOD ( 12.29 ) X-Spam-Score: -0.7 (/) Cc: John Stultz , Peter Maydell , Ulf Hansson , linux-mmc@vger.kernel.org, Chris Ball X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't need to verify the content of the status register twice, while we are about to handle a DATA irq. Instead let's leave all verification to be handled by mmci_data_irq(). Cc: Peter Maydell Cc: John Stultz Cc: Russell King Signed-off-by: Ulf Hansson --- drivers/mmc/host/mmci.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 6483c5c..a723ed2 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -888,6 +888,10 @@ static void mmci_data_irq(struct mmci_host *host, struct mmc_data *data, unsigned int status) { + /* Make sure we have data to handle */ + if (!data) + return; + /* First check for errors */ if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_STARTBITERR| MCI_TXUNDERRUN|MCI_RXOVERRUN)) { @@ -1206,7 +1210,6 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) do { struct mmc_command *cmd; - struct mmc_data *data; status = readl(host->base + MMCISTATUS); @@ -1232,11 +1235,7 @@ static irqreturn_t mmci_irq(int irq, void *dev_id) MCI_CMDSENT|MCI_CMDRESPEND) && cmd) mmci_cmd_irq(host, cmd, status); - data = host->data; - if (status & (MCI_DATACRCFAIL|MCI_DATATIMEOUT|MCI_STARTBITERR| - MCI_TXUNDERRUN|MCI_RXOVERRUN|MCI_DATAEND| - MCI_DATABLOCKEND) && data) - mmci_data_irq(host, data, status); + mmci_data_irq(host, host->data, status); /* Don't poll for busy completion in irq context. */ if (host->busy_status)