From patchwork Wed Mar 22 21:33:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9640101 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 E5E2760327 for ; Wed, 22 Mar 2017 21:34:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D77912521E for ; Wed, 22 Mar 2017 21:34:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC317262F2; Wed, 22 Mar 2017 21:34:35 +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 C05202521E for ; Wed, 22 Mar 2017 21:34:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752626AbdCVVec (ORCPT ); Wed, 22 Mar 2017 17:34:32 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:36813 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753656AbdCVVeQ (ORCPT ); Wed, 22 Mar 2017 17:34:16 -0400 Received: by mail-wr0-f193.google.com with SMTP id l37so28562316wrc.3 for ; Wed, 22 Mar 2017 14:34:15 -0700 (PDT) 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=OSojAVU3EP1gr2McUsunVmQL2w9SZB+PODCGoNq0sOA=; b=RhC2fvKWASN7l8NM8McJXfsD98RiUnewK6riADbXrohZj30JL6yb4YWYJxeqf1LbCq DJhYouP1xtrkJOrhHx7TLIKFXGW+W9BGpwpuFZTknatRM9lZ33clyaSM25y64+cmnboX DuzzJRhmPbQy3q4WgtXA7iZXnzsP53v3Z5qSiO/Tgx5TbZcmZSDHGBDqA79S/tiCjUPp b2yoAuiVo6IeUCyypx5Af83+dKRQmFQipMvtk72QRz3LnTWdEl2yKes5K4OIBvuU1YCK qZpZ2zK7NzlAFGyCi93Q77hpcFgiqDy9LpjCnBniPQjh8BqBS6ajJRwqey/8C7Ty+Hcc XDKA== 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=OSojAVU3EP1gr2McUsunVmQL2w9SZB+PODCGoNq0sOA=; b=Tfva3XVPI5B8T8afJ/17CQBsEWsqYwSd/mVvno/LDTE3FWnlOs0OIAvwy4k+fH9E5B lG3LBsiOfvOFSGKn75PNlOF1OFT2cZE2WE3YArH0Sk+VFLSHB7fR2Elrv3gfrf7wZfrI pllv0Ze2Qy7wuWrWUakBIZ/eeIl73jGPVpWxsEjVejQuL5IB+q+mlzlZG7JS4y5pNVea r6RfuVZYPG3bg9Xzneo8ATnBCsTs3vGYF+04oavB990x2R8IxUV2Hvm7UHH9XhUdZI6q G4qevJAmkJKQ+udj0oQbsrktX+aUsVchgy+thctgL6XQfGUOocHU9fFG8gFe+urgSjLe VZsA== X-Gm-Message-State: AFeK/H3wZHTN25gSeTE3T5u6uE4qiHuQRBq1r4H5r+Rwxbko+pLJNqVdvgDtv9TPD3B9vQ== X-Received: by 10.223.168.80 with SMTP id l74mr38993630wrc.184.1490218452990; Wed, 22 Mar 2017 14:34:12 -0700 (PDT) Received: from ?IPv6:2003:c6:ebdc:4000:94d5:56f1:aebf:596a? (p200300C6EBDC400094D556F1AEBF596A.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:94d5:56f1:aebf:596a]) by smtp.googlemail.com with ESMTPSA id t21sm1815669wmd.19.2017.03.22.14.34.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 14:34:12 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH 2/6] mmc: meson-gx: replace cmd->data in meson_mmc_start_cmd To: Ulf Hansson , Kevin Hilman References: <8bf58a83-d8d7-615c-c89b-87a62a3c9c40@gmail.com> Cc: "linux-mmc@vger.kernel.org" , linux-amlogic@lists.infradead.org Message-ID: <8c9c00f8-fd74-c9ae-552e-f518ae7844ce@gmail.com> Date: Wed, 22 Mar 2017 22:33:44 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <8bf58a83-d8d7-615c-c89b-87a62a3c9c40@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 Replace cmd->data with a local variable to simplify code a little. Signed-off-by: Heiner Kallweit --- drivers/mmc/host/meson-gx-mmc.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 04a55577..1b20ec1a 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -424,6 +424,7 @@ static void meson_mmc_request_done(struct mmc_host *mmc, static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd) { struct meson_host *host = mmc_priv(mmc); + struct mmc_data *data = cmd->data; struct sd_emmc_desc *desc, desc_tmp; u32 cfg; u8 blk_len, cmd_cfg_timeout; @@ -456,41 +457,41 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd) } /* data? */ - if (cmd->data) { + if (data) { desc->cmd_cfg |= CMD_CFG_DATA_IO; - if (cmd->data->blocks > 1) { + if (data->blocks > 1) { desc->cmd_cfg |= CMD_CFG_BLOCK_MODE; desc->cmd_cfg |= - (cmd->data->blocks & CMD_CFG_LENGTH_MASK) << + (data->blocks & CMD_CFG_LENGTH_MASK) << CMD_CFG_LENGTH_SHIFT; /* check if block-size matches, if not update */ cfg = readl(host->regs + SD_EMMC_CFG); blk_len = cfg & (CFG_BLK_LEN_MASK << CFG_BLK_LEN_SHIFT); blk_len >>= CFG_BLK_LEN_SHIFT; - if (blk_len != ilog2(cmd->data->blksz)) { + if (blk_len != ilog2(data->blksz)) { dev_dbg(host->dev, "%s: update blk_len %d -> %d\n", __func__, blk_len, - ilog2(cmd->data->blksz)); - blk_len = ilog2(cmd->data->blksz); + ilog2(data->blksz)); + blk_len = ilog2(data->blksz); cfg &= ~(CFG_BLK_LEN_MASK << CFG_BLK_LEN_SHIFT); cfg |= blk_len << CFG_BLK_LEN_SHIFT; writel(cfg, host->regs + SD_EMMC_CFG); } } else { desc->cmd_cfg |= - (cmd->data->blksz & CMD_CFG_LENGTH_MASK) << + (data->blksz & CMD_CFG_LENGTH_MASK) << CMD_CFG_LENGTH_SHIFT; } - cmd->data->bytes_xfered = 0; - xfer_bytes = cmd->data->blksz * cmd->data->blocks; - if (cmd->data->flags & MMC_DATA_WRITE) { + data->bytes_xfered = 0; + xfer_bytes = data->blksz * data->blocks; + if (data->flags & MMC_DATA_WRITE) { desc->cmd_cfg |= CMD_CFG_DATA_WR; WARN_ON(xfer_bytes > host->bounce_buf_size); - sg_copy_to_buffer(cmd->data->sg, cmd->data->sg_len, + sg_copy_to_buffer(data->sg, data->sg_len, host->bounce_buf, xfer_bytes); - cmd->data->bytes_xfered = xfer_bytes; + data->bytes_xfered = xfer_bytes; dma_wmb(); }