From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUf69-0004lx-ON for qemu-devel@nongnu.org; Mon, 31 Mar 2014 12:30:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUf62-0004SC-9O for qemu-devel@nongnu.org; Mon, 31 Mar 2014 12:30:09 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44417 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUf62-0004Rc-3N for qemu-devel@nongnu.org; Mon, 31 Mar 2014 12:30:02 -0400 Message-ID: <53399809.6010907@suse.de> Date: Mon, 31 Mar 2014 18:30:01 +0200 From: Alexander Graf MIME-Version: 1.0 References: <20140328105709.21018.88000.stgit@bahia.local> <20140328105740.21018.82087.stgit@bahia.local> In-Reply-To: <20140328105740.21018.82087.stgit@bahia.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 4/8] virtio-balloon: use virtio wrappers to access page frame numbers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: kwolf@redhat.com, peter.maydell@linaro.org, thuth@linux.vnet.ibm.com, mst@redhat.com, marc.zyngier@arm.com, rusty@rustcorp.com.au, qemu-devel@nongnu.org, stefanha@redhat.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, anthony@codemonkey.ws, afaerber@suse.de On 03/28/2014 11:57 AM, Greg Kurz wrote: > From: Rusty Russell > > Signed-off-by: Rusty Russell > Reviewed-by: Anthony Liguori > [ use per-device needs_byteswap flag, > Greg Kurz ] > Signed-off-by: Greg Kurz > --- > hw/virtio/virtio-balloon.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c > index a470a0b..e0b31ba 100644 > --- a/hw/virtio/virtio-balloon.c > +++ b/hw/virtio/virtio-balloon.c > @@ -30,6 +30,7 @@ > #endif > > #include "hw/virtio/virtio-bus.h" > +#include "hw/virtio/virtio-access.h" > > static void balloon_page(void *addr, int deflate) > { > @@ -192,7 +193,8 @@ static void virtio_balloon_handle_output(VirtIODevice *vdev, VirtQueue *vq) > ram_addr_t pa; > ram_addr_t addr; > > - pa = (ram_addr_t)ldl_p(&pfn) << VIRTIO_BALLOON_PFN_SHIFT; > + pa = (ram_addr_t)virtio_ldl_p(&pfn, > + vdev) << VIRTIO_BALLOON_PFN_SHIFT; This is quite unreadable. Just create a new small local variable for the load result :). Alex