diff mbox series

[v3,07/11] mmc: sdhci: use lower_32_bit2() and upper_32_bits() for setting adma_addr

Message ID 20200214074027.19824-8-yamada.masahiro@socionext.com
State Accepted
Commit a2b0221c9cb332415648c061c85f0ab1595c3429
Headers show
Series mmc: sdhci: code clean-up and fix cache coherency problem | expand

Commit Message

Masahiro Yamada Feb. 14, 2020, 7:40 a.m. UTC
Use {lower,upper}_32_bits() instead of the combination of cast
and shift.

Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
---

Changes in v3: None
Changes in v2: None

 drivers/mmc/sdhci.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Jaehoon Chung Feb. 18, 2020, 11:19 a.m. UTC | #1
On 2/14/20 4:40 PM, Masahiro Yamada wrote:
> Use {lower,upper}_32_bits() instead of the combination of cast
> and shift.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>

Reviewed-by: Jaehoon Chung <jh80.chung at samsung.com>

Best Regards,
Jaehoon Chung

> ---
> 
> Changes in v3: None
> Changes in v2: None
> 
>  drivers/mmc/sdhci.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index b4713e7b9bba..fefe81016eb1 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -153,9 +153,10 @@ static void sdhci_prepare_dma(struct sdhci_host *host, struct mmc_data *data,
>  	} else if (host->flags & (USE_ADMA | USE_ADMA64)) {
>  		sdhci_prepare_adma_table(host, data);
>  
> -		sdhci_writel(host, (u32)host->adma_addr, SDHCI_ADMA_ADDRESS);
> +		sdhci_writel(host, lower_32_bits(host->adma_addr),
> +			     SDHCI_ADMA_ADDRESS);
>  		if (host->flags & USE_ADMA64)
> -			sdhci_writel(host, (u64)host->adma_addr >> 32,
> +			sdhci_writel(host, upper_32_bits(host->adma_addr),
>  				     SDHCI_ADMA_ADDRESS_HI);
>  	}
>  
>
diff mbox series

Patch

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index b4713e7b9bba..fefe81016eb1 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -153,9 +153,10 @@  static void sdhci_prepare_dma(struct sdhci_host *host, struct mmc_data *data,
 	} else if (host->flags & (USE_ADMA | USE_ADMA64)) {
 		sdhci_prepare_adma_table(host, data);
 
-		sdhci_writel(host, (u32)host->adma_addr, SDHCI_ADMA_ADDRESS);
+		sdhci_writel(host, lower_32_bits(host->adma_addr),
+			     SDHCI_ADMA_ADDRESS);
 		if (host->flags & USE_ADMA64)
-			sdhci_writel(host, (u64)host->adma_addr >> 32,
+			sdhci_writel(host, upper_32_bits(host->adma_addr),
 				     SDHCI_ADMA_ADDRESS_HI);
 	}