From patchwork Tue Jan 31 20:58:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9548503 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 222E360415 for ; Tue, 31 Jan 2017 21:07:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 143B6281A7 for ; Tue, 31 Jan 2017 21:07:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 070AC2838E; Tue, 31 Jan 2017 21:07:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1956281A7 for ; Tue, 31 Jan 2017 21:07:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751405AbdAaVH1 (ORCPT ); Tue, 31 Jan 2017 16:07:27 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33996 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750933AbdAaVH0 (ORCPT ); Tue, 31 Jan 2017 16:07:26 -0500 Received: by mail-wm0-f66.google.com with SMTP id c85so947589wmi.1 for ; Tue, 31 Jan 2017 13:07:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=URjpcL3sdibrnOjMsvpMHdFWxs6Ydnp6uRDDgnaiZmI=; b=mtUlD1W8lrgqc9vzx9rOMofHyTihPmaj1dN8dgN8RAM1Vyn7Ery2xe4XW4UuiWQNEy iIebhjnn1vCW0Ik2+dO61zfuJQmm7tIsSZp9ePnzTYAmtTPfr+ujG65GP88GS+iq+TW2 aBmr/l6fZQ0xLv+P7h/TrEQtumDsasG13Iy5EsjWD/vevFY/+Ln2ykXMgBiE6gUw7nSi kQqxUIGrGzYPS+zECiBjaCYfVnouTRgXFdtyD+Jpeb1ecL6YbQTWrK56+rNcq8euG+Qw TKbwk7VdKZOVeR90C7XBxGcLgqQJ5RwEVDoWDL1/kVwyKIZceWfjDtimgfrwp23w0IFV GYAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=URjpcL3sdibrnOjMsvpMHdFWxs6Ydnp6uRDDgnaiZmI=; b=OS9VRdzseNuAX4JV9hiIgcA5GD2Z1Bpb2GEdgj6BXAdO/GntLt5abeUr1nt1UiHUwB ugpf8/PZ2Ls4XkmTmhSkzsbKyryk/mLTviSlIlP9QNYZCb8V86IrdrCsfbJTC0qU0vEw lbnjOTetN8geSGZ1ExxE8HlE8i3GVzOWZz6JjEKZouy4FiJiP9E3WzXH/1vhb+u08N/9 vMwV17BPo/4L4B3sqO8wsqyQwBxXs3msiGbDP7xPu8YhjtgBJhHojmMioydRnIc8Jo5b AypjnJmXC35GC9AeX5yW/5uR1vNlQu03oPIYcjVLxZnluU9CSkoKm6WVDH1/QTjjKe38 R0Kg== X-Gm-Message-State: AIkVDXLPYY4LWuAYoIVdqpAsiAXAQ6cJP/dRa9TORtSetf3ZtSEm7bpXmfqma2SBTrs+8g== X-Received: by 10.28.216.130 with SMTP id p124mr18867523wmg.58.1485896358494; Tue, 31 Jan 2017 12:59:18 -0800 (PST) Received: from ?IPv6:2003:c6:ebc5:6c00:bc31:e1d5:58cd:f318? (p200300C6EBC56C00BC31E1D558CDF318.dip0.t-ipconnect.de. [2003:c6:ebc5:6c00:bc31:e1d5:58cd:f318]) by smtp.googlemail.com with ESMTPSA id x39sm30346161wrb.3.2017.01.31.12.59.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jan 2017 12:59:18 -0800 (PST) From: Heiner Kallweit Subject: [PATCH 4/9] mmc: meson-gx: improve meson_mmc_irq_thread To: Ulf Hansson References: <24e8bf35-50ce-270d-c0aa-12bb90d2e3d8@gmail.com> Cc: Carlo Caione , Kevin Hilman , linux-mmc@vger.kernel.org Message-ID: Date: Tue, 31 Jan 2017 21:58:09 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <24e8bf35-50ce-270d-c0aa-12bb90d2e3d8@gmail.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove unneeded variable ret and simplify the if block. Signed-off-by: Heiner Kallweit --- drivers/mmc/host/meson-gx-mmc.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 529a4f22..4ce4c640 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -670,7 +670,6 @@ static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id) struct mmc_command *cmd = host->cmd; struct mmc_data *data; unsigned int xfer_bytes; - int ret = IRQ_HANDLED; if (WARN_ON(!mrq)) return IRQ_NONE; @@ -679,14 +678,12 @@ static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id) return IRQ_NONE; data = cmd->data; - if (data) { + if (data && data->flags & MMC_DATA_READ) { xfer_bytes = data->blksz * data->blocks; - if (data->flags & MMC_DATA_READ) { - WARN_ON(xfer_bytes > host->bounce_buf_size); - sg_copy_from_buffer(data->sg, data->sg_len, - host->bounce_buf, xfer_bytes); - data->bytes_xfered = xfer_bytes; - } + WARN_ON(xfer_bytes > host->bounce_buf_size); + sg_copy_from_buffer(data->sg, data->sg_len, + host->bounce_buf, xfer_bytes); + data->bytes_xfered = xfer_bytes; } meson_mmc_read_resp(host->mmc, cmd); @@ -695,7 +692,7 @@ static irqreturn_t meson_mmc_irq_thread(int irq, void *dev_id) else meson_mmc_start_cmd(host->mmc, data->stop); - return ret; + return IRQ_HANDLED; } /*