All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-trivial] [PATCH] hw/sh4/sh_pci.c: Use ldl_le_p() and stl_le_p()
Date: Mon, 13 Jun 2016 08:55:22 +0200	[thread overview]
Message-ID: <20160613065522.GA7847@aurel32.net> (raw)
In-Reply-To: <1465575021-3774-1-git-send-email-peter.maydell@linaro.org>

On 2016-06-10 17:10, Peter Maydell wrote:
> Use ldl_le_p() and stl_le_p() instead of le32_to_cpup() and
> cpu_to_le32w(); the former handle misaligned addresses and don't
> need casts, and the latter are deprecated.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/sh4/sh_pci.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/sh4/sh_pci.c b/hw/sh4/sh_pci.c
> index e820a32..1747628 100644
> --- a/hw/sh4/sh_pci.c
> +++ b/hw/sh4/sh_pci.c
> @@ -55,7 +55,7 @@ static void sh_pci_reg_write (void *p, hwaddr addr, uint64_t val,
>  
>      switch(addr) {
>      case 0 ... 0xfc:
> -        cpu_to_le32w((uint32_t*)(pcic->dev->config + addr), val);
> +        stl_le_p(pcic->dev->config + addr, val);
>          break;
>      case 0x1c0:
>          pcic->par = val;
> @@ -85,7 +85,7 @@ static uint64_t sh_pci_reg_read (void *p, hwaddr addr,
>  
>      switch(addr) {
>      case 0 ... 0xfc:
> -        return le32_to_cpup((uint32_t*)(pcic->dev->config + addr));
> +        return ldl_le_p(pcic->dev->config + addr);
>      case 0x1c0:
>          return pcic->par;
>      case 0x1c4:

Thanks for the patch. I confirm it builds and works fine.

Acked-by: Aurelien Jarno <aurelien@aurel32.net>

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net


WARNING: multiple messages have this Message-ID (diff)
From: Aurelien Jarno <aurelien@aurel32.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] hw/sh4/sh_pci.c: Use ldl_le_p() and stl_le_p()
Date: Mon, 13 Jun 2016 08:55:22 +0200	[thread overview]
Message-ID: <20160613065522.GA7847@aurel32.net> (raw)
In-Reply-To: <1465575021-3774-1-git-send-email-peter.maydell@linaro.org>

On 2016-06-10 17:10, Peter Maydell wrote:
> Use ldl_le_p() and stl_le_p() instead of le32_to_cpup() and
> cpu_to_le32w(); the former handle misaligned addresses and don't
> need casts, and the latter are deprecated.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  hw/sh4/sh_pci.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/sh4/sh_pci.c b/hw/sh4/sh_pci.c
> index e820a32..1747628 100644
> --- a/hw/sh4/sh_pci.c
> +++ b/hw/sh4/sh_pci.c
> @@ -55,7 +55,7 @@ static void sh_pci_reg_write (void *p, hwaddr addr, uint64_t val,
>  
>      switch(addr) {
>      case 0 ... 0xfc:
> -        cpu_to_le32w((uint32_t*)(pcic->dev->config + addr), val);
> +        stl_le_p(pcic->dev->config + addr, val);
>          break;
>      case 0x1c0:
>          pcic->par = val;
> @@ -85,7 +85,7 @@ static uint64_t sh_pci_reg_read (void *p, hwaddr addr,
>  
>      switch(addr) {
>      case 0 ... 0xfc:
> -        return le32_to_cpup((uint32_t*)(pcic->dev->config + addr));
> +        return ldl_le_p(pcic->dev->config + addr);
>      case 0x1c0:
>          return pcic->par;
>      case 0x1c4:

Thanks for the patch. I confirm it builds and works fine.

Acked-by: Aurelien Jarno <aurelien@aurel32.net>

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurelien@aurel32.net                 http://www.aurel32.net

  parent reply	other threads:[~2016-06-13  6:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 16:10 [Qemu-trivial] [PATCH] hw/sh4/sh_pci.c: Use ldl_le_p() and stl_le_p() Peter Maydell
2016-06-10 16:10 ` [Qemu-devel] " Peter Maydell
2016-06-11 20:41 ` [Qemu-trivial] " Eric Blake
2016-06-11 20:41   ` Eric Blake
2016-06-13  6:55 ` Aurelien Jarno [this message]
2016-06-13  6:55   ` Aurelien Jarno
2016-06-28 14:38   ` [Qemu-trivial] " Peter Maydell
2016-06-28 14:38     ` [Qemu-devel] " Peter Maydell

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=20160613065522.GA7847@aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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.