All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: "Benoît Canet" <benoit.canet@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 02/11] mcf_uart: convert to memory API
Date: Tue, 22 Nov 2011 17:52:22 +0200	[thread overview]
Message-ID: <4ECBC536.8080107@redhat.com> (raw)
In-Reply-To: <1321971808-20072-3-git-send-email-benoit.canet@gmail.com>

On 11/22/2011 04:23 PM, Benoît Canet wrote:
> Signed-off-by: Benoît Canet <benoit.canet@gmail.com>
> ---
>  hw/mcf.h      |   11 +++++++----
>  hw/mcf5206.c  |   25 +++++++++++++------------
>  hw/mcf5208.c  |    6 +++---
>  hw/mcf_uart.c |   34 +++++++++++++++-------------------
>  4 files changed, 38 insertions(+), 38 deletions(-)
>
>  
> -static uint32_t m5206_mbar_read(m5206_mbar_state *s, uint32_t offset)
> +static uint64_t m5206_mbar_read(m5206_mbar_state *s,
> +                                uint64_t offset, unsigned size)
>  {
>      if (offset >= 0x100 && offset < 0x120) {
>          return m5206_timer_read(s->timer[0], offset - 0x100);
>      } else if (offset >= 0x120 && offset < 0x140) {
>          return m5206_timer_read(s->timer[1], offset - 0x120);
>      } else if (offset >= 0x140 && offset < 0x160) {
> -        return mcf_uart_read(s->uart[0], offset - 0x140);
> +        return mcf_uart_read(s->uart[0], offset - 0x140, size);
>      } else if (offset >= 0x180 && offset < 0x1a0) {
> -        return mcf_uart_read(s->uart[1], offset - 0x180);
> +        return mcf_uart_read(s->uart[1], offset - 0x180, size);
>      }

Note: this is best done as subregions.  Of course, for the conversion it
is best to do the minimal change, as you did, and leave bigger changes
for later.

> @@ -387,7 +388,7 @@ static uint32_t m5206_mbar_readb(void *opaque, target_phys_addr_t offset)
>          }
>          return val & 0xff;
>      }
> -    return m5206_mbar_read(s, offset);
> +    return (uint32_t)m5206_mbar_read(s, offset, 1);
>  }
>  
>  static uint32_t m5206_mbar_readw(void *opaque, target_phys_addr_t offset)
> @@ -411,7 +412,7 @@ static uint32_t m5206_mbar_readw(void *opaque, target_phys_addr_t offset)
>          val |= m5206_mbar_readb(opaque, offset + 1);
>          return val;
>      }
> -    return m5206_mbar_read(s, offset);
> +    return (uint32_t)m5206_mbar_read(s, offset, 2);
>  }

No need for these pointless casts (but don't repost, unless there are
other comments).

-- 
error compiling committee.c: too many arguments to function

  reply	other threads:[~2011-11-22 15:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-22 14:23 [Qemu-devel] [PATCH 00/11] more memory API conversion Benoît Canet
2011-11-22 14:23 ` [Qemu-devel] [PATCH 01/11] mcf5206: convert to memory API Benoît Canet
2011-11-22 14:23 ` [Qemu-devel] [PATCH 02/11] mcf_uart: " Benoît Canet
2011-11-22 15:52   ` Avi Kivity [this message]
2011-11-22 14:23 ` [Qemu-devel] [PATCH 03/11] mcf_fec: " Benoît Canet
2011-11-22 14:23 ` [Qemu-devel] [PATCH 04/11] mcf_intc: " Benoît Canet
2011-11-22 14:23 ` [Qemu-devel] [PATCH 05/11] lm32_uart: " Benoît Canet
2011-11-22 15:59   ` Avi Kivity
2011-11-22 14:23 ` [Qemu-devel] [PATCH 06/11] lm32_sys: " Benoît Canet
2011-11-22 14:23 ` [Qemu-devel] [PATCH 07/11] bonito: convert north bridge register mapping " Benoît Canet
2011-11-22 14:23 ` [Qemu-devel] [PATCH 08/11] bonito: convert north bridge pci config " Benoît Canet
2011-11-22 14:23 ` [Qemu-devel] [PATCH 09/11] bonito: convert south " Benoît Canet
2011-11-22 14:23 ` [Qemu-devel] [PATCH 10/11] bonito: convert ldma " Benoît Canet
2011-11-22 14:23 ` [Qemu-devel] [PATCH 11/11] bonito: convert cop " Benoît Canet

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=4ECBC536.8080107@redhat.com \
    --to=avi@redhat.com \
    --cc=benoit.canet@gmail.com \
    --cc=qemu-devel@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.