All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio: drop duplicate virtio_queue_get_id() function
@ 2016-05-20 18:04 Stefan Hajnoczi
  2016-05-31 22:11 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Hajnoczi @ 2016-05-20 18:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Stefan Hajnoczi

The virtio_queue_get_id() function is the lesser used duplicate of
virtio_get_queue_index().  Use the latter instead.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 hw/scsi/virtio-scsi.c      | 2 +-
 hw/virtio/virtio.c         | 7 -------
 include/hw/virtio/virtio.h | 1 -
 3 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 30415c6..f55fe06 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -185,7 +185,7 @@ static void virtio_scsi_save_request(QEMUFile *f, SCSIRequest *sreq)
 {
     VirtIOSCSIReq *req = sreq->hba_private;
     VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(req->dev);
-    uint32_t n = virtio_queue_get_id(req->vq) - 2;
+    uint32_t n = virtio_get_queue_index(req->vq) - 2;
 
     assert(n < vs->conf.num_queues);
     qemu_put_be32s(f, &n);
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 30ede3d..7ed06ea 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1062,13 +1062,6 @@ int virtio_get_num_queues(VirtIODevice *vdev)
     return i;
 }
 
-int virtio_queue_get_id(VirtQueue *vq)
-{
-    VirtIODevice *vdev = vq->vdev;
-    assert(vq >= &vdev->vq[0] && vq < &vdev->vq[VIRTIO_QUEUE_MAX]);
-    return vq - &vdev->vq[0];
-}
-
 void virtio_queue_set_align(VirtIODevice *vdev, int n, int align)
 {
     BusState *qbus = qdev_get_parent_bus(DEVICE(vdev));
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 6a37065..96b581d 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -243,7 +243,6 @@ void virtio_queue_set_last_avail_idx(VirtIODevice *vdev, int n, uint16_t idx);
 void virtio_queue_invalidate_signalled_used(VirtIODevice *vdev, int n);
 VirtQueue *virtio_get_queue(VirtIODevice *vdev, int n);
 uint16_t virtio_get_queue_index(VirtQueue *vq);
-int virtio_queue_get_id(VirtQueue *vq);
 EventNotifier *virtio_queue_get_guest_notifier(VirtQueue *vq);
 void virtio_queue_set_guest_notifier_fd_handler(VirtQueue *vq, bool assign,
                                                 bool with_irqfd);
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio: drop duplicate virtio_queue_get_id() function
  2016-05-20 18:04 [Qemu-devel] [PATCH] virtio: drop duplicate virtio_queue_get_id() function Stefan Hajnoczi
@ 2016-05-31 22:11 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2016-05-31 22:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 522 bytes --]

On Fri, May 20, 2016 at 11:04:21AM -0700, Stefan Hajnoczi wrote:
> The virtio_queue_get_id() function is the lesser used duplicate of
> virtio_get_queue_index().  Use the latter instead.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  hw/scsi/virtio-scsi.c      | 2 +-
>  hw/virtio/virtio.c         | 7 -------
>  include/hw/virtio/virtio.h | 1 -
>  3 files changed, 1 insertion(+), 9 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-31 22:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-20 18:04 [Qemu-devel] [PATCH] virtio: drop duplicate virtio_queue_get_id() function Stefan Hajnoczi
2016-05-31 22:11 ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.