diff mbox series

[2/2] ram: sifive: Fix compiler warnings for 32-bit

Message ID 1597738161-28989-2-git-send-email-bmeng.cn@gmail.com
State Accepted
Commit 3ab260105214d56a419c84e6dacbb8ae514548f1
Delegated to: Andes
Headers show
Series [1/2] riscv: fu540: Use correct API to get L2 cache controller base address | expand

Commit Message

Bin Meng Aug. 18, 2020, 8:09 a.m. UTC
From: Bin Meng <bin.meng@windriver.com>

priv->info.size is of type 'size_t' but the length modifier is l.
Fix this by casting priv->info.size. Note 'z' cannot be used as
the modifier as SPL does not support that.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
---

 drivers/ram/sifive/fu540_ddr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Rick Chen Aug. 20, 2020, 7:34 a.m. UTC | #1
> From: Bin Meng [mailto:bmeng.cn@gmail.com]
> Sent: Tuesday, August 18, 2020 4:09 PM
> To: Rick Jian-Zhi Chen(陳建志); Pragnesh Patel; U-Boot Mailing List
> Cc: Bin Meng
> Subject: [PATCH 2/2] ram: sifive: Fix compiler warnings for 32-bit
>
> From: Bin Meng <bin.meng@windriver.com>
>
> priv->info.size is of type 'size_t' but the length modifier is l.
> Fix this by casting priv->info.size. Note 'z' cannot be used as
> the modifier as SPL does not support that.
>
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> ---
>
>  drivers/ram/sifive/fu540_ddr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Rick Chen <rick@andestech.com>
Pragnesh Patel Aug. 20, 2020, 12:11 p.m. UTC | #2
>-----Original Message-----
>From: Bin Meng <bmeng.cn@gmail.com>
>Sent: 18 August 2020 13:39
>To: Rick Chen <rick@andestech.com>; Pragnesh Patel
><pragnesh.patel@openfive.com>; U-Boot Mailing List <u-boot@lists.denx.de>
>Cc: Bin Meng <bin.meng@windriver.com>
>Subject: [PATCH 2/2] ram: sifive: Fix compiler warnings for 32-bit
>
>[External Email] Do not click links or attachments unless you recognize the
>sender and know the content is safe
>
>From: Bin Meng <bin.meng@windriver.com>
>
>priv->info.size is of type 'size_t' but the length modifier is l.
>Fix this by casting priv->info.size. Note 'z' cannot be used as the modifier as SPL
>does not support that.
>
>Signed-off-by: Bin Meng <bin.meng@windriver.com>
>---
>
> drivers/ram/sifive/fu540_ddr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Pragnesh Patel <pragnesh.patel@openfive.com>
diff mbox series

Patch

diff --git a/drivers/ram/sifive/fu540_ddr.c b/drivers/ram/sifive/fu540_ddr.c
index 2eef1e7..5ff8869 100644
--- a/drivers/ram/sifive/fu540_ddr.c
+++ b/drivers/ram/sifive/fu540_ddr.c
@@ -316,12 +316,12 @@  static int fu540_ddr_setup(struct udevice *dev)
 	priv->info.size = get_ram_size((long *)priv->info.base,
 				       ddr_size);
 
-	debug("%s : %lx\n", __func__, priv->info.size);
+	debug("%s : %lx\n", __func__, (uintptr_t)priv->info.size);
 
 	/* check memory access for all memory */
 	if (priv->info.size != ddr_size) {
 		printf("DDR invalid size : 0x%lx, expected 0x%lx\n",
-		       priv->info.size, (uintptr_t)ddr_size);
+		       (uintptr_t)priv->info.size, (uintptr_t)ddr_size);
 		return -EINVAL;
 	}