summaryrefslogtreecommitdiff
path: root/cmd/itest.c
diff options
context:
space:
mode:
authorKunihiko Hayashi <hayashi.kunihiko@socionext.com>2016-05-04 14:20:04 +0900
committerTom Rini <trini@konsulko.com>2016-05-27 10:01:07 -0400
commitdafd64888c21abc43edbe7634b8edaacf9e2fe5c (patch)
tree2e15ae2288084dc8ad25376191072037f47a6766 /cmd/itest.c
parenta565386762162019c297b8537f17bb3f4d4d4d88 (diff)
downloadu-boot-imx-dafd64888c21abc43edbe7634b8edaacf9e2fe5c.zip
u-boot-imx-dafd64888c21abc43edbe7634b8edaacf9e2fe5c.tar.gz
u-boot-imx-dafd64888c21abc43edbe7634b8edaacf9e2fe5c.tar.bz2
cmd: replace the cast of the memory access to a fixed bit type in itest
This patch fixes a bug that long word(.l) memory access in 'itest' command reads the 8bytes of the actual memory on 64-bit architecture. The cast to the memory pointer should use a fixed bit type. Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd/itest.c')
-rw-r--r--cmd/itest.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/itest.c b/cmd/itest.c
index fb4d797..60626c7 100644
--- a/cmd/itest.c
+++ b/cmd/itest.c
@@ -65,13 +65,13 @@ static long evalexp(char *s, int w)
}
switch (w) {
case 1:
- l = (long)(*(unsigned char *)buf);
+ l = (long)(*(u8 *)buf);
break;
case 2:
- l = (long)(*(unsigned short *)buf);
+ l = (long)(*(u16 *)buf);
break;
case 4:
- l = (long)(*(unsigned long *)buf);
+ l = (long)(*(u32 *)buf);
break;
}
unmap_physmem(buf, w);