From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUf7d-0006oP-3z for qemu-devel@nongnu.org; Mon, 31 Mar 2014 12:31:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUf7W-00057a-NE for qemu-devel@nongnu.org; Mon, 31 Mar 2014 12:31:41 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44452 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUf7W-00057U-HB for qemu-devel@nongnu.org; Mon, 31 Mar 2014 12:31:34 -0400 Message-ID: <53399865.6040708@suse.de> Date: Mon, 31 Mar 2014 18:31:33 +0200 From: Alexander Graf MIME-Version: 1.0 References: <20140328105709.21018.88000.stgit@bahia.local> <20140328105748.21018.45271.stgit@bahia.local> In-Reply-To: <20140328105748.21018.45271.stgit@bahia.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 5/8] virtio-blk: use virtio wrappers to access headers 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 > > Note that st*_raw and ld*_raw are effectively replaced by st*_p and ld*_p. > > Signed-off-by: Rusty Russell > Reviewed-by: Anthony Liguori > [ use per-device needs_byteswap flag, > Greg Kurz ] > Signed-off-by: Greg Kurz > --- > hw/block/virtio-blk.c | 40 +++++++++++++++++++++++----------------- > 1 file changed, 23 insertions(+), 17 deletions(-) > > diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c > index 8a568e5..c652ff2 100644 > --- a/hw/block/virtio-blk.c > +++ b/hw/block/virtio-blk.c > @@ -26,6 +26,7 @@ > # include > #endif > #include "hw/virtio/virtio-bus.h" > +#include "hw/virtio/virtio-access.h" > > typedef struct VirtIOBlockReq > { > @@ -77,7 +78,9 @@ static void virtio_blk_rw_complete(void *opaque, int ret) > trace_virtio_blk_rw_complete(req, ret); > > if (ret) { > - bool is_read = !(ldl_p(&req->out->type) & VIRTIO_BLK_T_OUT); > + bool is_read = > + !(virtio_ldl_p(&req->out->type, > + VIRTIO_DEVICE(req->dev)) & VIRTIO_BLK_T_OUT); Any way you could fit this into the line limit by extracting part of it into a separate variable? Alex