From patchwork Fri Mar 22 00:17:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rusty Russell X-Patchwork-Id: 229874 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A9EDC2C00A4 for ; Fri, 22 Mar 2013 14:04:45 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754471Ab3CVDEl (ORCPT ); Thu, 21 Mar 2013 23:04:41 -0400 Received: from ozlabs.org ([203.10.76.45]:57608 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751604Ab3CVDEk (ORCPT ); Thu, 21 Mar 2013 23:04:40 -0400 Received: by ozlabs.org (Postfix, from userid 1011) id C9BDC2C00C1; Fri, 22 Mar 2013 14:04:37 +1100 (EST) From: Rusty Russell To: Cornelia Huck Cc: mst@redhat.com, netdev@vger.kernel.org Subject: Re: virtio: remove obsolete virtqueue_get_queue_index() In-Reply-To: <20130321100146.7a741c75@gondolin> References: <878v5hp6hc.fsf@rustcorp.com.au> <20130321100146.7a741c75@gondolin> User-Agent: Notmuch/0.14 (http://notmuchmail.org) Emacs/23.4.1 (i686-pc-linux-gnu) Date: Fri, 22 Mar 2013 10:47:34 +1030 Message-ID: <87ehf8fftt.fsf@rustcorp.com.au> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Cornelia Huck writes: > On Thu, 21 Mar 2013 17:47:03 +1030 > Rusty Russell wrote: > >> You can access it directly now, since 3.8: v3.7-rc1-13-g06ca287 >> 'virtio: move queue_index and num_free fields into core struct >> virtqueue.' >> >> Cc: Cornelia Huck >> Signed-off-by: Rusty Russell ... >> @@ -610,7 +610,7 @@ static struct virtqueue *virtio_ccw_vq_by_ind(struct virtio_ccw_device *vcdev, >> vq = NULL; >> spin_lock_irqsave(&vcdev->lock, flags); >> list_for_each_entry(info, &vcdev->virtqueues, node) { >> - if (virtqueue_get_queue_index(info->vq) == index) { >> + if (vq->index == index) { > > Should be > if (info->vq->index == index) { > >> vq = info->vq; >> break; >> } Thanks, fixed. virtio: remove obsolete virtqueue_get_queue_index() You can access it directly now, since 3.8: v3.7-rc1-13-g06ca287 'virtio: move queue_index and num_free fields into core struct virtqueue.' Cc: Cornelia Huck Signed-off-by: Rusty Russell Acked-by: Cornelia Huck --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index d88d436..24fc9f5 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -153,7 +153,7 @@ struct padded_vnet_hdr { */ static int vq2txq(struct virtqueue *vq) { - return (virtqueue_get_queue_index(vq) - 1) / 2; + return (vq->index - 1) / 2; } static int txq2vq(int txq) @@ -163,7 +163,7 @@ static int txq2vq(int txq) static int vq2rxq(struct virtqueue *vq) { - return virtqueue_get_queue_index(vq) / 2; + return vq->index / 2; } static int rxq2vq(int rxq) diff --git a/drivers/s390/kvm/virtio_ccw.c b/drivers/s390/kvm/virtio_ccw.c index 2029b6c..a7eddc7 100644 --- a/drivers/s390/kvm/virtio_ccw.c +++ b/drivers/s390/kvm/virtio_ccw.c @@ -166,7 +166,7 @@ static void virtio_ccw_kvm_notify(struct virtqueue *vq) vcdev = to_vc_device(info->vq->vdev); ccw_device_get_schid(vcdev->cdev, &schid); - do_kvm_notify(schid, virtqueue_get_queue_index(vq)); + do_kvm_notify(schid, vq->index); } static int virtio_ccw_read_vq_conf(struct virtio_ccw_device *vcdev, @@ -188,7 +188,7 @@ static void virtio_ccw_del_vq(struct virtqueue *vq, struct ccw1 *ccw) unsigned long flags; unsigned long size; int ret; - unsigned int index = virtqueue_get_queue_index(vq); + unsigned int index = vq->index; /* Remove from our list. */ spin_lock_irqsave(&vcdev->lock, flags); @@ -610,7 +610,7 @@ static struct virtqueue *virtio_ccw_vq_by_ind(struct virtio_ccw_device *vcdev, vq = NULL; spin_lock_irqsave(&vcdev->lock, flags); list_for_each_entry(info, &vcdev->virtqueues, node) { - if (virtqueue_get_queue_index(info->vq) == index) { + if (info->vq->index == index) { vq = info->vq; break; } diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 833f17b..9ff8645 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -76,12 +76,6 @@ void *virtqueue_detach_unused_buf(struct virtqueue *vq); unsigned int virtqueue_get_vring_size(struct virtqueue *vq); -/* FIXME: Obsolete accessor, but required for virtio_net merge. */ -static inline unsigned int virtqueue_get_queue_index(struct virtqueue *vq) -{ - return vq->index; -} - /** * virtio_device - representation of a device using virtio * @index: unique position on the virtio bus