public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] cmd: replace the cast of the memory access to a fixed bit type in itest
@ 2016-05-04  5:20 Masahiro Yamada
  2016-05-04  5:22 ` Stefan Roese
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Masahiro Yamada @ 2016-05-04  5:20 UTC (permalink / raw)
  To: u-boot

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);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] cmd: replace the cast of the memory access to a fixed bit type in itest
  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
  2016-05-19  3:59 ` Simon Glass
  2016-05-30 17:56 ` [U-Boot] " Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Roese @ 2016-05-04  5:22 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] cmd: replace the cast of the memory access to a fixed bit type in itest
  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
@ 2016-05-19  3:59 ` Simon Glass
  2016-05-30 17:56 ` [U-Boot] " Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2016-05-19  3:59 UTC (permalink / raw)
  To: u-boot

On 3 May 2016 at 23:20, Masahiro Yamada <yamada.masahiro@socionext.com> 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(-)

Reviewed-by: Simon Glass <sjg@chromium.org>


>
> 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);
> --
> 1.9.1
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] cmd: replace the cast of the memory access to a fixed bit type in itest
  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
  2016-05-19  3:59 ` Simon Glass
@ 2016-05-30 17:56 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2016-05-30 17:56 UTC (permalink / raw)
  To: u-boot

On Wed, May 04, 2016 at 02:20:04PM +0900, 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>
> Reviewed-by: Stefan Roese <sr@denx.de>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

-- 
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>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-30 17:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2016-05-19  3:59 ` Simon Glass
2016-05-30 17:56 ` [U-Boot] " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox