summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2020-07-06 08:28:04 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2020-07-14 20:28:09 +0200
commit4c0809a21073af2d482683ec5327f59b31c355ff (patch)
treeeb095ccd77faa95c56d8a8e7addec237f79e0e94
parentdf694a4bc4e7c030a976f4d7b704d621a00e4dd8 (diff)
downloadbarebox-4c0809a21073af2d482683ec5327f59b31c355ff.tar.gz
barebox-4c0809a21073af2d482683ec5327f59b31c355ff.tar.xz
sandbox: os: common: fix compiler warning in add_image()
GCC reports: ./arch/sandbox/os/common.c: In function ‘add_image’: ./arch/sandbox/os/common.c:271:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] This is because hf->base is an unsigned long long, with the upper 32 bit all-zeroes on 32-bit systems. The compiler doesn't see that though. Change the cast, so we no longer warn. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/sandbox/os/common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c
index 382a923040..534571c0e6 100644
--- a/arch/sandbox/os/common.c
+++ b/arch/sandbox/os/common.c
@@ -268,7 +268,7 @@ static int add_image(char *str, char *devname_template, int *devname_number)
hf->base = (unsigned long)mmap(NULL, hf->size,
PROT_READ | (readonly ? 0 : PROT_WRITE),
MAP_SHARED, fd, 0);
- if ((void *)hf->base == MAP_FAILED)
+ if (hf->base == (unsigned long)MAP_FAILED)
printf("warning: mmapping %s failed: %s\n", filename, strerror(errno));
ret = barebox_register_filedev(hf);