From patchwork Wed Feb 1 06:48:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9548961 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 57BAF604A7 for ; Wed, 1 Feb 2017 06:50:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4974227F82 for ; Wed, 1 Feb 2017 06:50:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E49E2840E; Wed, 1 Feb 2017 06:50:25 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,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 0D24A27F82 for ; Wed, 1 Feb 2017 06:50:25 +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 1cYokD-0004PB-MM; Wed, 01 Feb 2017 06:50:17 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cYok6-00034I-ML for linux-amlogic@lists.infradead.org; Wed, 01 Feb 2017 06:50:12 +0000 Received: by mail-wm0-x241.google.com with SMTP id v77so3585029wmv.0 for ; Tue, 31 Jan 2017 22:49:50 -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=UqwDe/FONQavjTWjCJrz23C25keL+RqnssqyV4Ee4zw=; b=kERVlDzckzGqrxxeLH15OHeun3zhBKndcZksXQlmq/me/QmFPVtauph6DI4xbMVobD virjsILe/q2vdYykcwIrV1kkJQhY4Vz2gUI9TsFPAHyD6RlkiKcBW95lT132asT+NVYd RNAY+/GI36Xaa6LBdYLv+5AzUDJC+zlRFd4bDSvnKPR4qH4YayPpKAf/b2BX6ZjLV634 FPGDAxM0qQxh0g//EX2vo/qDhCVfwPVd8NrQHyGWOLBOLojXTmRcCQwLHy8QStpVsRl2 jvsbcVumnIYwEo/BYDeeJ0l1OEorR5s1O3/Lh36GxMvZnKJvoeA8qkHgLHN2XpGD2giL 2gEg== 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=UqwDe/FONQavjTWjCJrz23C25keL+RqnssqyV4Ee4zw=; b=a2UifymoMoOhbptc3YpNjDePsSL3mo3oI/aPCsTtHcgZnUGVCmuATARjYPYiEnFqyR QBXhmn60pjE8bOOfDya54lMfkTGxpLrIVAZK7p/OUVx4qVfL8dV2Kn3rHfTH3d2nPwMf g2MyT7V8TyR5ZKYAuOCNbsQpLZuGqnJfYtdPVD9T41ZnrFh0CPS8Xn6cViis96Gfdm31 w6i7hfwEUvyVVIeAk5RIzvcUv4NXjIeMVdzUDSJiJ0qFkmlnZb2Qc2JtJGLKJXkaAQ6m kLEOAy4CtJbbDxpbLmg1qoz7/VeHAt6wH6P/GYlDczR2G0zQr2TkxG407tunJu1WZIe7 08Qg== X-Gm-Message-State: AIkVDXIS4M5OWERi1/UxSLSJZHrjiEoMJUK5Fdcnkq5bwHuJ92SZELBEl6wLFRt/ep6p0w== X-Received: by 10.28.69.202 with SMTP id l71mr22452197wmi.68.1485931788891; Tue, 31 Jan 2017 22:49:48 -0800 (PST) Received: from ?IPv6:2003:c6:ebc5:6c00:c4cb:dab7:ab36:4977? (p200300C6EBC56C00C4CBDAB7AB364977.dip0.t-ipconnect.de. [2003:c6:ebc5:6c00:c4cb:dab7:ab36:4977]) by smtp.googlemail.com with ESMTPSA id q4sm32241132wrc.35.2017.01.31.22.49.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jan 2017 22:49:48 -0800 (PST) From: Heiner Kallweit Subject: [PATCH v2 4/9] mmc: meson-gx: improve meson_mmc_irq_thread To: Ulf Hansson , Carlo Caione , Kevin Hilman References: <584e5061-d359-1436-05ee-3767a5a4b10f@gmail.com> Message-ID: <460d2337-7865-6c9c-21b6-98c2ea070926@gmail.com> Date: Wed, 1 Feb 2017 07:48:49 +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: <584e5061-d359-1436-05ee-3767a5a4b10f@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170131_225011_000255_293F319F X-CRM114-Status: UNSURE ( 9.99 ) 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: 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 --- v2: - 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 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; } /*