From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cmd: replace the cast of the memory access to a fixed bit type in itest
Date: Wed, 4 May 2016 07:22:35 +0200 [thread overview]
Message-ID: <5729871B.9080905@denx.de> (raw)
In-Reply-To: <1462339204-3362-1-git-send-email-yamada.masahiro@socionext.com>
On 04.05.2016 07:20, Masahiro Yamada wrote:
> From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
>
> 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>
> ---
>
> 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 <sr@denx.de>
Thanks,
Stefan
next prev parent reply other threads:[~2016-05-04 5:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-04 5:20 [U-Boot] [PATCH] cmd: replace the cast of the memory access to a fixed bit type in itest Masahiro Yamada
2016-05-04 5:22 ` Stefan Roese [this message]
2016-05-19 3:59 ` Simon Glass
2016-05-30 17:56 ` [U-Boot] " Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5729871B.9080905@denx.de \
--to=sr@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.