Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp709134ybl; Wed, 28 Aug 2019 04:16:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzs88jFCYfK2JKTx6mCTNGcEnK3JKgBaKtArqJA0sN1XvhtlGqY7RMGga561iVRYlgB0LKu X-Received: by 2002:a63:b102:: with SMTP id r2mr2939193pgf.370.1566991018695; Wed, 28 Aug 2019 04:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566991018; cv=none; d=google.com; s=arc-20160816; b=uvS3uRVM8aHhJIotfKizMlHEUin+h4tk9GGcpDUXu8Aw3ZXa5vpuO+iDrTUeqCwji8 +uXRU1Djv7l3ZL4SlZQ0ZHZdVM1YtJXZmBU8QlEJquiVG9UH8aFeyuB447JxHR6HGV91 RlCERtUAoHN63P4TddAyh1xk/0ehyol6/Tb14JMO40DqwQSBGwGlleFNJrRTILQdTdPI /w4oqJ+xQICTjaW+YT/doW4w6njQ/jp6zSW4U3+VK7ktVA/W119PCS1adQbm634BuL76 iSZ9Ix/mpaDv7Vzn7zwKGWWq1HWX4gq3WBG6VACryTZKYmApCX4kF5pHOZH9mWFmxob/ m78w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=MdtqdcsaYYtubyrph0eVlOgNKdl1skgOg+CqHwrAlBI=; b=JAjY8lqLyMwtmABVvAp+4nUy0w5lsFT7dA/9TbxEZ1vP3grIkEubbIo+P3E4+lMyMW b2dsq24SnO521N4R+CrRCZbvS5a2k2sUd3kO3yF0QI/+jlOlylDa1BI3SLyoiWIgmPzF 5EL7s3mJukF1glmKRcnyVkwM5TUQiyXSTNoEWz/9LbuHTeGCvEKWbo2XiFOug0n/Kq4r mD9V2FgCS+0b/dDusIrkgjee17UJiiBmp/7CnzBVyEaUmgZLotB6pylo2rkazXuMYCHB HuM61mFhY203enjI+QFa+dfERlhu9mxUzKFRHs6MtkUXFp8abaPAkjiygYwfEfPoniG9 x14Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=GflElf6h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si1684507pjv.80.2019.08.28.04.16.42; Wed, 28 Aug 2019 04:16:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=GflElf6h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726432AbfH1LPs (ORCPT + 99 others); Wed, 28 Aug 2019 07:15:48 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:36514 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725991AbfH1LPs (ORCPT ); Wed, 28 Aug 2019 07:15:48 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x7SBF8HP005401; Wed, 28 Aug 2019 20:15:08 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x7SBF8HP005401 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1566990909; bh=MdtqdcsaYYtubyrph0eVlOgNKdl1skgOg+CqHwrAlBI=; h=From:To:Cc:Subject:Date:From; b=GflElf6h+dvtfciFao7F+P2gIOJLedbsXJT5Vd65bQqphG5BPKBHhf8ogZgp9pqxw 8OapcO/+xmabw9r0t4r/t0XKm7NoFkO2aOS8YiaeQ+5PlJF+e83przEhH+igEiZuYx 5kTi/VX+M45Cw3UchMm/OZZar2yzAqmIS9BgH2LKZNC0VSGYfvqxE72/VGbHF66pBB 1YHIlYJPJQoVsTwJFeazWf37unbLhz2I6ZcG0ERQ52YlJn3nZwQDlW+TkI8VIUvSRT cowsq9jIyhkWU5ej5FAcBOGS+aRakF4xJHl1JW6b5erMUcqHgegyvWaJ0WSY4CNTmC LHxajcsg1rYuA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mmc@vger.kernel.org, Adrian Hunter , Ulf Hansson Cc: Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH] mmc: sdhci: use lower/upper_32_bits() macros for DMA addresses Date: Wed, 28 Aug 2019 20:14:53 +0900 Message-Id: <20190828111453.4023-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, the DMA addresses are casted to (u64) for the upper 32bits to avoid "right shift count >= width of type" warning. provides macros to address this, and the macro names are self-documenting. Signed-off-by: Masahiro Yamada --- drivers/mmc/host/sdhci.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index a5dc5aae973e..07144a195a9f 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -668,10 +668,10 @@ void sdhci_adma_write_desc(struct sdhci_host *host, void **desc, /* 32-bit and 64-bit descriptors have these members in same position */ dma_desc->cmd = cpu_to_le16(cmd); dma_desc->len = cpu_to_le16(len); - dma_desc->addr_lo = cpu_to_le32((u32)addr); + dma_desc->addr_lo = cpu_to_le32(lower_32_bits(addr)); if (host->flags & SDHCI_USE_64_BIT_DMA) - dma_desc->addr_hi = cpu_to_le32((u64)addr >> 32); + dma_desc->addr_hi = cpu_to_le32(upper_32_bits(addr)); *desc += host->desc_sz; } @@ -827,9 +827,10 @@ static dma_addr_t sdhci_sdma_address(struct sdhci_host *host) static void sdhci_set_sdma_addr(struct sdhci_host *host, dma_addr_t addr) { if (host->v4_mode) { - sdhci_writel(host, addr, SDHCI_ADMA_ADDRESS); + sdhci_writel(host, lower_32_bits(addr), SDHCI_ADMA_ADDRESS); if (host->flags & SDHCI_USE_64_BIT_DMA) - sdhci_writel(host, (u64)addr >> 32, SDHCI_ADMA_ADDRESS_HI); + sdhci_writel(host, upper_32_bits(addr), + SDHCI_ADMA_ADDRESS_HI); } else { sdhci_writel(host, addr, SDHCI_DMA_ADDRESS); } @@ -1096,10 +1097,11 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd) } else if (host->flags & SDHCI_USE_ADMA) { sdhci_adma_table_pre(host, data, sg_cnt); - sdhci_writel(host, host->adma_addr, SDHCI_ADMA_ADDRESS); + sdhci_writel(host, lower_32_bits(host->adma_addr), + SDHCI_ADMA_ADDRESS); if (host->flags & SDHCI_USE_64_BIT_DMA) sdhci_writel(host, - (u64)host->adma_addr >> 32, + upper_32_bits(host->adma_addr), SDHCI_ADMA_ADDRESS_HI); } else { WARN_ON(sg_cnt != 1); -- 2.17.1