diff mbox series

[1/1] sandbox: cast to pointer from integer of different size

Message ID 20220612112523.6081-1-xypron.glpk@gmx.de
State Accepted
Commit d4462ba0443d4ea7de290b2ccf90b2a1c0122b93
Delegated to: Simon Glass
Headers show
Series [1/1] sandbox: cast to pointer from integer of different size | expand

Commit Message

Heinrich Schuchardt June 12, 2022, 11:25 a.m. UTC
Building sandbox_defconfig on ARMv7 with HOST_32BIT=y results in:

drivers/misc/qfw_sandbox.c:51:25: warning:
cast to pointer from integer of different size [-Wint-to-pointer-cast]
   51 |         void *address = (void *)be64_to_cpu(dma->address);

Add the missing type conversion.

Fixes: 69512551aa84 ("test: qemu: add qfw sandbox driver, dm tests, qemu tests")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/misc/qfw_sandbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.36.1

Comments

Bin Meng June 12, 2022, 12:05 p.m. UTC | #1
On Sun, Jun 12, 2022 at 7:25 PM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Building sandbox_defconfig on ARMv7 with HOST_32BIT=y results in:
>
> drivers/misc/qfw_sandbox.c:51:25: warning:
> cast to pointer from integer of different size [-Wint-to-pointer-cast]
>    51 |         void *address = (void *)be64_to_cpu(dma->address);
>
> Add the missing type conversion.
>
> Fixes: 69512551aa84 ("test: qemu: add qfw sandbox driver, dm tests, qemu tests")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/misc/qfw_sandbox.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Simon Glass June 28, 2022, 1:37 p.m. UTC | #2
On Sun, Jun 12, 2022 at 7:25 PM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Building sandbox_defconfig on ARMv7 with HOST_32BIT=y results in:
>
> drivers/misc/qfw_sandbox.c:51:25: warning:
> cast to pointer from integer of different size [-Wint-to-pointer-cast]
>    51 |         void *address = (void *)be64_to_cpu(dma->address);
>
> Add the missing type conversion.
>
> Fixes: 69512551aa84 ("test: qemu: add qfw sandbox driver, dm tests, qemu tests")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/misc/qfw_sandbox.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/drivers/misc/qfw_sandbox.c b/drivers/misc/qfw_sandbox.c
index b09974d33b..1002df7533 100644
--- a/drivers/misc/qfw_sandbox.c
+++ b/drivers/misc/qfw_sandbox.c
@@ -48,7 +48,7 @@  static void qfw_sandbox_read_entry_dma(struct udevice *dev, struct qfw_dma *dma)
 {
 	u16 entry;
 	u32 control = be32_to_cpu(dma->control);
-	void *address = (void *)be64_to_cpu(dma->address);
+	void *address = (void *)(uintptr_t)be64_to_cpu(dma->address);
 	u32 length = be32_to_cpu(dma->length);
 	struct qfw_sandbox_plat *plat = dev_get_plat(dev);
 	struct fw_cfg_file *file;