From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masahiro Yamada Date: Thu, 22 Jun 2017 17:58:09 +0900 Subject: [U-Boot] [PATCH] mmc: cadence: use fdt32_t for DT property value to fix sparse warning Message-ID: <1498121889-17168-1-git-send-email-yamada.masahiro@socionext.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de DTB is encoded in big endian. When we retrieve property values, we need to use fdt32_to_cpu (aka be32_to_cpu) for endian conversion. This is a bit error-prone, but sparse is useful to detect endian mismatch. We need to use (fdt32_t *) instead of (u32 *) for a pointer of a property value. Otherwise sparse warns "cast to restricted __be32". Signed-off-by: Masahiro Yamada --- drivers/mmc/sdhci-cadence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/sdhci-cadence.c b/drivers/mmc/sdhci-cadence.c index 4bd2623eaef9..f83c1d724108 100644 --- a/drivers/mmc/sdhci-cadence.c +++ b/drivers/mmc/sdhci-cadence.c @@ -92,7 +92,7 @@ static int sdhci_cdns_write_phy_reg(struct sdhci_cdns_plat *plat, static int sdhci_cdns_phy_init(struct sdhci_cdns_plat *plat, const void *fdt, int nodeoffset) { - const u32 *prop; + const fdt32_t *prop; int ret, i; for (i = 0; i < ARRAY_SIZE(sdhci_cdns_phy_cfgs); i++) { -- 2.7.4