diff mbox series

mmc: sdhci: Use upper/lower_32_bits macros

Message ID fcd5a85e43cf821c0523f8beac5ed10185e904a9.1596030244.git.michal.simek@xilinx.com
State Accepted
Commit b5a3387dc163dbb958c362d95ddc7415bebdca61
Delegated to: Peng Fan
Headers show
Series mmc: sdhci: Use upper/lower_32_bits macros | expand

Commit Message

Michal Simek July 29, 2020, 1:44 p.m. UTC
Instead of recasting and shifting use macros which are designed for taking
upper/lower 32bit value from 64bit variable.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 drivers/mmc/sdhci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Michal Simek Aug. 20, 2020, 8:04 a.m. UTC | #1
st 29. 7. 2020 v 15:44 odesílatel Michal Simek <michal.simek@xilinx.com> napsal:
>
> Instead of recasting and shifting use macros which are designed for taking
> upper/lower 32bit value from 64bit variable.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  drivers/mmc/sdhci.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index ec6c493fb642..f5fbbacee542 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -749,9 +749,9 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
>                                             "sdhci-caps-mask", 0);
>         dt_caps = dev_read_u64_default(host->mmc->dev,
>                                        "sdhci-caps", 0);
> -       caps = ~(u32)dt_caps_mask &
> +       caps = ~lower_32_bits(dt_caps_mask) &
>                sdhci_readl(host, SDHCI_CAPABILITIES);
> -       caps |= (u32)dt_caps;
> +       caps |= lower_32_bits(dt_caps);
>  #else
>         caps = sdhci_readl(host, SDHCI_CAPABILITIES);
>  #endif
> @@ -794,9 +794,9 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
>         /* Check whether the clock multiplier is supported or not */
>         if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
>  #if CONFIG_IS_ENABLED(DM_MMC)
> -               caps_1 = ~(u32)(dt_caps_mask >> 32) &
> +               caps_1 = ~upper_32_bits(dt_caps_mask) &
>                          sdhci_readl(host, SDHCI_CAPABILITIES_1);
> -               caps_1 |= (u32)(dt_caps >> 32);
> +               caps_1 |= upper_32_bits(dt_caps);
>  #else
>                 caps_1 = sdhci_readl(host, SDHCI_CAPABILITIES_1);
>  #endif
> --
> 2.27.0
>

Applied.
M
diff mbox series

Patch

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index ec6c493fb642..f5fbbacee542 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -749,9 +749,9 @@  int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
 					    "sdhci-caps-mask", 0);
 	dt_caps = dev_read_u64_default(host->mmc->dev,
 				       "sdhci-caps", 0);
-	caps = ~(u32)dt_caps_mask &
+	caps = ~lower_32_bits(dt_caps_mask) &
 	       sdhci_readl(host, SDHCI_CAPABILITIES);
-	caps |= (u32)dt_caps;
+	caps |= lower_32_bits(dt_caps);
 #else
 	caps = sdhci_readl(host, SDHCI_CAPABILITIES);
 #endif
@@ -794,9 +794,9 @@  int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
 	/* Check whether the clock multiplier is supported or not */
 	if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
 #if CONFIG_IS_ENABLED(DM_MMC)
-		caps_1 = ~(u32)(dt_caps_mask >> 32) &
+		caps_1 = ~upper_32_bits(dt_caps_mask) &
 			 sdhci_readl(host, SDHCI_CAPABILITIES_1);
-		caps_1 |= (u32)(dt_caps >> 32);
+		caps_1 |= upper_32_bits(dt_caps);
 #else
 		caps_1 = sdhci_readl(host, SDHCI_CAPABILITIES_1);
 #endif