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>
This commit is contained in:
Kunihiko Hayashi 2016-05-04 14:20:04 +09:00 committed by Tom Rini
parent a565386762
commit dafd64888c
1 changed files with 3 additions and 3 deletions

View File

@ -65,13 +65,13 @@ static long evalexp(char *s, int w)
} }
switch (w) { switch (w) {
case 1: case 1:
l = (long)(*(unsigned char *)buf); l = (long)(*(u8 *)buf);
break; break;
case 2: case 2:
l = (long)(*(unsigned short *)buf); l = (long)(*(u16 *)buf);
break; break;
case 4: case 4:
l = (long)(*(unsigned long *)buf); l = (long)(*(u32 *)buf);
break; break;
} }
unmap_physmem(buf, w); unmap_physmem(buf, w);