From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Wed, 4 May 2016 07:22:35 +0200 Subject: [U-Boot] [PATCH] cmd: replace the cast of the memory access to a fixed bit type in itest In-Reply-To: <1462339204-3362-1-git-send-email-yamada.masahiro@socionext.com> References: <1462339204-3362-1-git-send-email-yamada.masahiro@socionext.com> Message-ID: <5729871B.9080905@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 04.05.2016 07:20, Masahiro Yamada wrote: > From: Kunihiko Hayashi > > 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 > --- > > cmd/itest.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/cmd/itest.c b/cmd/itest.c > index fb4d797..60626c7 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); > Reviewed-by: Stefan Roese Thanks, Stefan