From: Kunihiko Hayashi Date: Wed, 4 May 2016 05:20:04 +0000 (+0900) Subject: cmd: replace the cast of the memory access to a fixed bit type in itest X-Git-Tag: v2016.07-rc1~159 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=dafd64888c21abc43edbe7634b8edaacf9e2fe5c;p=u-boot 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 Signed-off-by: Masahiro Yamada Reviewed-by: Stefan Roese Reviewed-by: Simon Glass --- diff --git a/cmd/itest.c b/cmd/itest.c index fb4d797e43..60626c7fe9 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);