Skip to content
Snippets Groups Projects
Commit dafd6488 authored by Kunihiko Hayashi's avatar Kunihiko Hayashi Committed by Tom Rini
Browse files

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: default avatarKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: default avatarStefan Roese <sr@denx.de>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent a5653867
No related branches found
No related tags found
No related merge requests found
...@@ -65,13 +65,13 @@ static long evalexp(char *s, int w) ...@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment