From patchwork Tue Feb 7 21:34:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9561213 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 8641A6047A for ; Tue, 7 Feb 2017 21:37:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7863828485 for ; Tue, 7 Feb 2017 21:37:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C4E628492; Tue, 7 Feb 2017 21:37:45 +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=-1.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D544B28485 for ; Tue, 7 Feb 2017 21:37:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cbDSF-0003Vx-FQ; Tue, 07 Feb 2017 21:37:39 +0000 Received: from mail-wm0-f67.google.com ([74.125.82.67]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cbDSB-0003Pt-55 for linux-amlogic@lists.infradead.org; Tue, 07 Feb 2017 21:37:37 +0000 Received: by mail-wm0-f67.google.com with SMTP id v77so30621172wmv.0 for ; Tue, 07 Feb 2017 13:37:17 -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=3K1WOnwzMCKitfmh1R9NJnU1c0P+0depPUXf/qm5zM8=; b=gMwZY1Nqa6zzua2W8COfzu6zTGl84ZQuONNDZymb/JUPq8upYimVI51y1MUmKkMhAN Mmwm8/vrOuThjUiH/wjSySUnJKOIENDx4pJRuN4TYo82wtvys3tusGtK5795NqHBbpa5 wBzSrTjDQF/1gM0Mpme6zDa9A28JrZO2mHb2Vy3eMz24nn4sECx+2DOYScz0f6gdQeUp zqMykrQ93RQYsvROWXwWUtWssjMOvXBEdlZYOVpZ37OgLQviY8WCHWdzHPetWTRHfrqt OIjmQV+80xGijppqY91oUUVmnSeldcQTCO4+N4SxvADd9W9sWLHfPph50wd4GJiHBvuH udug== 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=3K1WOnwzMCKitfmh1R9NJnU1c0P+0depPUXf/qm5zM8=; b=kDkfwnlWiqEV+JhxF5a9sSFBnGxBJ+Efm8PIIv/j20wlItm2XAsiwHnWfqxqJgSU7Y rVidxLHe0aldqSzS/m2sGEUEHGRH+YXjKnmWpZ7i01BS7jxuSnHQjvll+PUVcbKrVIlC fBqRI1KvVK+k4bscvokTRPLrqL+TdzQbbtPPTQ+/u7S2M8xbJ7j09zhNkk0xt8mdT2xw VtmZVQw37ZyeEfwh3JdW72kekpfPuFHM8Hp1ULpHh7TiOWS+39DYesvpDD/EZg/fsNPv p/QSklE+rCjs6ep3SoBpT6ia4FpikePgifiNkk4LQ0zokzTF6X5Cv4hHxv6KSBvr5YwD S7WQ== X-Gm-Message-State: AMke39mjJ9jS6/XDfBQ2KwPfBjWqaPMCLJ3n02WgKzVUkV8Ds09e631hI0+er/rzi5DqvQ== X-Received: by 10.28.140.130 with SMTP id o124mr15821424wmd.48.1486503376498; Tue, 07 Feb 2017 13:36:16 -0800 (PST) Received: from ?IPv6:2003:c6:ebce:1e00:cd3f:c3c7:98c5:4fec? (p200300C6EBCE1E00CD3FC3C798C54FEC.dip0.t-ipconnect.de. [2003:c6:ebce:1e00:cd3f:c3c7:98c5:4fec]) by smtp.googlemail.com with ESMTPSA id l37sm9387874wrc.41.2017.02.07.13.36.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 13:36:16 -0800 (PST) From: Heiner Kallweit Subject: [PATCH v3 4/9] mmc: meson-gx: improve meson_mmc_irq_thread To: Ulf Hansson , Kevin Hilman References: <0991d40b-e05b-2fcb-9ee4-7b529448de69@gmail.com> Message-ID: <21f34e8d-471d-375b-cb9d-6b551d6b03fe@gmail.com> Date: Tue, 7 Feb 2017 22:34:41 +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: <0991d40b-e05b-2fcb-9ee4-7b529448de69@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170207_133735_351571_22D013C2 X-CRM114-Status: UNSURE ( 9.67 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carlo Caione , linux-amlogic@lists.infradead.org, "linux-mmc@vger.kernel.org" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Remove unneeded variable ret and simplify the if block. Signed-off-by: Heiner Kallweit Acked-by: Kevin Hilman --- v3: - no changes --- 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 d6a4dfae..dd7f936c 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -666,7 +666,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; @@ -675,14 +674,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); @@ -691,7 +688,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; } /*