Commit dafd6488 authored by Kunihiko Hayashi's avatar Kunihiko Hayashi Committed by Tom Rini

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 <>
Signed-off-by: default avatarMasahiro Yamada <>
Reviewed-by: default avatarStefan Roese <>
Reviewed-by: default avatarSimon Glass <>
parent a5653867
......@@ -65,13 +65,13 @@ static long evalexp(char *s, int w)
switch (w) {
case 1:
l = (long)(*(unsigned char *)buf);
l = (long)(*(u8 *)buf);
case 2:
l = (long)(*(unsigned short *)buf);
l = (long)(*(u16 *)buf);
case 4:
l = (long)(*(unsigned long *)buf);
l = (long)(*(u32 *)buf);
unmap_physmem(buf, w);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment