Received: from eggs.gnu.org ([2001:4830:134:3::10]:45190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDvHz-0001os-Iq for qemu-devel@nongnu.org; Wed, 21 Jan 2015 08:25:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YDvHw-0000Mz-8N for qemu-devel@nongnu.org; Wed, 21 Jan 2015 08:25:43 -0500 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:47337) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YDvHv-0000MJ-Uj for qemu-devel@nongnu.org; Wed, 21 Jan 2015 08:25:40 -0500 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Jan 2015 13:25:37 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 5E3931B08061 for ; Wed, 21 Jan 2015 13:25:37 +0000 (GMT) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t0LDPZpl53674176 for ; Wed, 21 Jan 2015 13:25:35 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t0LDPZbA017102 for ; Wed, 21 Jan 2015 06:25:35 -0700 Date: Wed, 21 Jan 2015 14:25:32 +0100 From: Greg Kurz Message-ID: <20150121142532.6f2092c8@bahia.local> In-Reply-To: <1421687077-9025-2-git-send-email-stefanha@redhat.com> References: <1421687077-9025-1-git-send-email-stefanha@redhat.com> <1421687077-9025-2-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] dataplane: move vring_more_avail() into vring.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, David Gibson On Mon, 19 Jan 2015 17:04:36 +0000 Stefan Hajnoczi wrote: > vring_more_avail() was an inline function in vring.h. No external > callers use it so it's not necessary to export it. > > Furthermore, we'll need virtio-access.h for endian-aware memory accesses > but that only works in per-target object files (obj-y) and not > build-once object files (common-obj-y) like the virtio-blk and > virtio-scsi devices. > > Move vring_more_avail() into vring.c so that virtio devices like > virtio-blk and virtio-scsi can continue to use vring.h without being > built once per target. > > Signed-off-by: Stefan Hajnoczi > --- Yes, this function should definitely be declared in more appropriate scope. And BTW I remember Cornelia had the same concern in the virtio-1 serie. :) Reviewed-by: Greg Kurz > hw/virtio/dataplane/vring.c | 6 ++++++ > include/hw/virtio/dataplane/vring.h | 6 ------ > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/hw/virtio/dataplane/vring.c b/hw/virtio/dataplane/vring.c > index 61f6d83..cb31d7f 100644 > --- a/hw/virtio/dataplane/vring.c > +++ b/hw/virtio/dataplane/vring.c > @@ -21,6 +21,12 @@ > #include "hw/virtio/dataplane/vring.h" > #include "qemu/error-report.h" > > +/* Are there more descriptors available? */ > +static inline bool vring_more_avail(Vring *vring) > +{ > + return vring->vr.avail->idx != vring->last_avail_idx; > +} > + > /* vring_map can be coupled with vring_unmap or (if you still have the > * value returned in *mr) memory_region_unref. > */ > diff --git a/include/hw/virtio/dataplane/vring.h b/include/hw/virtio/dataplane/vring.h > index d3e086a..1e871e6 100644 > --- a/include/hw/virtio/dataplane/vring.h > +++ b/include/hw/virtio/dataplane/vring.h > @@ -36,12 +36,6 @@ static inline unsigned int vring_get_num(Vring *vring) > return vring->vr.num; > } > > -/* Are there more descriptors available? */ > -static inline bool vring_more_avail(Vring *vring) > -{ > - return vring->vr.avail->idx != vring->last_avail_idx; > -} > - > /* Fail future vring_pop() and vring_push() calls until reset */ > static inline void vring_set_broken(Vring *vring) > {