cmd: replace the cast of the memory access to a fixed bit type in itest
PATCH 1/1 cmd: replace the cast of the memory access to a fixed bit type in itest
From: Kunihiko Hayashi <[email protected]>
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.
---
cmd/itest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
cmd/itest.c +3 -3
@@ -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);
Signature · 1 line
1.9.1
PATCH 1/1 cmd: replace the cast of the memory access to a fixed bit type in itest
Quoted 25 lines · Masahiro Yamada
From: Kunihiko Hayashi <[email protected]>
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 <[email protected]>Signed-off-by Masahiro Yamada <[email protected]>---
cmd/itest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)cmd/itest.c +1
-1@@ -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 ;
cmd/itest.c static long evalexp(char *s, int w) · line 77
Quoted 10 lines
cmd/itest.c +2
-2case 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);
Thanks,
Stefan
PATCH 1/1 cmd: replace the cast of the memory access to a fixed bit type in itest
In reply to Masahiro YamadaQuoted 6 lines · Masahiro Yamada
From: Kunihiko Hayashi <[email protected]>
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.
Quoted 6 lines
Signed-off-by Kunihiko Hayashi <[email protected]>Signed-off-by Masahiro Yamada <[email protected]>---
cmd/itest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Quoted 25 lines
cmd/itest.c +3
-4@@ -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); --1.9.1
Quoted 10 lines · Masahiro Yamada
From: Kunihiko Hayashi <[email protected]>
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 <[email protected]>Signed-off-by Masahiro Yamada <[email protected]>Reviewed-by Stefan Roese <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160530/40816c0a/attachment.sig>