From patchwork Sat Feb 18 11:50:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9581055 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 C3C256049F for ; Sat, 18 Feb 2017 11:50:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A876428734 for ; Sat, 18 Feb 2017 11:50:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B15D28778; Sat, 18 Feb 2017 11:50:52 +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 F18A228734 for ; Sat, 18 Feb 2017 11:50:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752912AbdBRLuv (ORCPT ); Sat, 18 Feb 2017 06:50:51 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36440 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752845AbdBRLut (ORCPT ); Sat, 18 Feb 2017 06:50:49 -0500 Received: by mail-wm0-f66.google.com with SMTP id r18so6583782wmd.3 for ; Sat, 18 Feb 2017 03:50:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=Crg7OAy37gtIv6Nt7smySmEogfsd0L1FlebSGLQHZnw=; b=s4ABeCd2Lu8ZXLUE8gTZ3r7Qi0ID3aZHWM2CryW1hawkmvJsCpIOP1LvSHbnCuckmZ IWzwvM2+H6pLRdrvOm/Oc7qXllfk7QAWrZttX4ISi7vabPfN+1+4nuVa5oRV1SVIJ3U+ BQgmRoTSPs7JqpSbc3m1aszPad0f4P078PKJfrzmhavNIzrtBrnl5uQcWE1XekLej1Qe ulXN2sCdTNj//SDPiL+9h9mRRkw/HBobr+MlZRVtWUsNOpdxP0uCmPHQ/DbJOclh6eRO jv4j5/oXRkRyJ7tNFuSVzMAP6NGFSGufYBw8KR1KHUg/4zCjkHRDMayZs7MnY4xLpCG/ wlHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=Crg7OAy37gtIv6Nt7smySmEogfsd0L1FlebSGLQHZnw=; b=JmGdEBec2ojmdqF0LdyMyLcGkJ9cxlTlInRYW5KxE3CXskhIf4SbwH2hsKJubSGTFG sFmgnrKMGu5F66K84ChnPAG/SzFPYKSf2zYtoeDArgc774Se4nY+BqG5bbxclJ0A/jJi 5+lQSUl1PrfWPoLGdvOkD137XTUfIHvgaII71sHh4DXJrRd9UR7sOwpC4uTnbhgRzJrg PbxY4m/ENVh5TazieTUwS8071bPpi+VFY3An6jdEyn1xrw3mFKyRh2UMFe8kI0Vm7iqr 80jiJtvlXQOi1TaNhQMhOvoC579Y0iPxm3wEssuNg2KxN2x+Uuxn3QwvF8/G7xJd/Pd1 tgRg== X-Gm-Message-State: AMke39lui7rZlrLyVijC8Wozpcwr1tgAOpQ+NUWD9/KzU+T0gOZHIZkOCt2Zxmj5xWyxqA== X-Received: by 10.28.24.5 with SMTP id 5mr4835202wmy.1.1487418648314; Sat, 18 Feb 2017 03:50:48 -0800 (PST) Received: from ?IPv6:2003:c6:ebdc:4000:7c19:f774:dabe:f95d? (p200300C6EBDC40007C19F774DABEF95D.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:7c19:f774:dabe:f95d]) by smtp.googlemail.com with ESMTPSA id e14sm5393126wmd.14.2017.02.18.03.50.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Feb 2017 03:50:47 -0800 (PST) To: Ulf Hansson , Kevin Hilman Cc: "linux-mmc@vger.kernel.org" , linux-amlogic@lists.infradead.org From: Heiner Kallweit Subject: [PATCH v3 1/10] mmc: meson-gx: simplify bounce buffer setting in meson_mmc_start_cmd Message-ID: <583f6496-68a9-b8e1-6b25-1f073f819a3c@gmail.com> Date: Sat, 18 Feb 2017 12:50:31 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 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 Core ensures that there are no commands with cmd->data being set and nothing to transfer. And we don't have to reset bit CMD_CFG_DATA_NUM because cmd_cfg was zero-initialized and this bit isn't set. Signed-off-by: Heiner Kallweit Acked-by: Kevin Hilman --- v2: - adjusted commit message because branch xfer_bytes == 0 is never reached - added acked-by v3: - no changes --- drivers/mmc/host/meson-gx-mmc.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 5a959783..07a7399c 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -516,14 +516,7 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd) desc->cmd_cfg &= ~CMD_CFG_DATA_WR; } - if (xfer_bytes > 0) { - desc->cmd_cfg &= ~CMD_CFG_DATA_NUM; - desc->cmd_data = host->bounce_dma_addr & CMD_DATA_MASK; - } else { - /* write data to data_addr */ - desc->cmd_cfg |= CMD_CFG_DATA_NUM; - desc->cmd_data = 0; - } + desc->cmd_data = host->bounce_dma_addr & CMD_DATA_MASK; cmd_cfg_timeout = 12; } else {