From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSseB-0005YQ-GB for qemu-devel@nongnu.org; Tue, 22 Nov 2011 10:52:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSse5-0002Jj-J2 for qemu-devel@nongnu.org; Tue, 22 Nov 2011 10:52:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSse5-0002Jc-5y for qemu-devel@nongnu.org; Tue, 22 Nov 2011 10:52:29 -0500 Message-ID: <4ECBC536.8080107@redhat.com> Date: Tue, 22 Nov 2011 17:52:22 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1321971808-20072-1-git-send-email-benoit.canet@gmail.com> <1321971808-20072-3-git-send-email-benoit.canet@gmail.com> In-Reply-To: <1321971808-20072-3-git-send-email-benoit.canet@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 02/11] mcf_uart: convert to memory API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?QmVub8OudCBDYW5ldA==?= Cc: qemu-devel@nongnu.org On 11/22/2011 04:23 PM, Beno=C3=AEt Canet wrote: > Signed-off-by: Beno=C3=AEt Canet > --- > hw/mcf.h | 11 +++++++---- > hw/mcf5206.c | 25 +++++++++++++------------ > hw/mcf5208.c | 6 +++--- > hw/mcf_uart.c | 34 +++++++++++++++------------------- > 4 files changed, 38 insertions(+), 38 deletions(-) > > =20 > -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 >=3D 0x100 && offset < 0x120) { > return m5206_timer_read(s->timer[0], offset - 0x100); > } else if (offset >=3D 0x120 && offset < 0x140) { > return m5206_timer_read(s->timer[1], offset - 0x120); > } else if (offset >=3D 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 >=3D 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, targ= et_phys_addr_t offset) > } > return val & 0xff; > } > - return m5206_mbar_read(s, offset); > + return (uint32_t)m5206_mbar_read(s, offset, 1); > } > =20 > static uint32_t m5206_mbar_readw(void *opaque, target_phys_addr_t offs= et) > @@ -411,7 +412,7 @@ static uint32_t m5206_mbar_readw(void *opaque, targ= et_phys_addr_t offset) > val |=3D 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). --=20 error compiling committee.c: too many arguments to function