Blame 0006-virtio-scsi-clean-up-virtio_scsi_handle_cmd_vq.patch

a575c5
From: Stefan Hajnoczi <stefanha@redhat.com>
a575c5
Date: Tue, 17 May 2022 09:28:19 +0100
a575c5
Subject: [PATCH] virtio-scsi: clean up virtio_scsi_handle_cmd_vq()
a575c5
Content-type: text/plain
a575c5
a575c5
virtio_scsi_handle_cmd_vq() is only called from hw/scsi/virtio-scsi.c
a575c5
now and its return value is no longer used. Remove the function
a575c5
prototype from virtio-scsi.h and drop the return value.
a575c5
a575c5
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
a575c5
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
a575c5
Message-id: 20220427143541.119567-6-stefanha@redhat.com
a575c5
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
a575c5
(cherry picked from commit ad482b57ef841b2d4883c5079d20ba44ff5e4b3e)
a575c5
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
a575c5
---
a575c5
 hw/scsi/virtio-scsi.c           | 5 +----
a575c5
 include/hw/virtio/virtio-scsi.h | 1 -
a575c5
 2 files changed, 1 insertion(+), 5 deletions(-)
a575c5
a575c5
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
a575c5
index eefda16e4b..12c6a21202 100644
a575c5
--- a/hw/scsi/virtio-scsi.c
a575c5
+++ b/hw/scsi/virtio-scsi.c
a575c5
@@ -685,12 +685,11 @@ static void virtio_scsi_handle_cmd_req_submit(VirtIOSCSI *s, VirtIOSCSIReq *req)
a575c5
     scsi_req_unref(sreq);
a575c5
 }
a575c5
 
a575c5
-bool virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq)
a575c5
+static void virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq)
a575c5
 {
a575c5
     VirtIOSCSIReq *req, *next;
a575c5
     int ret = 0;
a575c5
     bool suppress_notifications = virtio_queue_get_notification(vq);
a575c5
-    bool progress = false;
a575c5
 
a575c5
     QTAILQ_HEAD(, VirtIOSCSIReq) reqs = QTAILQ_HEAD_INITIALIZER(reqs);
a575c5
 
a575c5
@@ -700,7 +699,6 @@ bool virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq)
a575c5
         }
a575c5
 
a575c5
         while ((req = virtio_scsi_pop_req(s, vq))) {
a575c5
-            progress = true;
a575c5
             ret = virtio_scsi_handle_cmd_req_prepare(s, req);
a575c5
             if (!ret) {
a575c5
                 QTAILQ_INSERT_TAIL(&reqs, req, next);
a575c5
@@ -725,7 +723,6 @@ bool virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq)
a575c5
     QTAILQ_FOREACH_SAFE(req, &reqs, next, next) {
a575c5
         virtio_scsi_handle_cmd_req_submit(s, req);
a575c5
     }
a575c5
-    return progress;
a575c5
 }
a575c5
 
a575c5
 static void virtio_scsi_handle_cmd(VirtIODevice *vdev, VirtQueue *vq)
a575c5
diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h
a575c5
index 44dc3b81ec..2497530064 100644
a575c5
--- a/include/hw/virtio/virtio-scsi.h
a575c5
+++ b/include/hw/virtio/virtio-scsi.h
a575c5
@@ -151,7 +151,6 @@ void virtio_scsi_common_realize(DeviceState *dev,
a575c5
                                 Error **errp);
a575c5
 
a575c5
 void virtio_scsi_common_unrealize(DeviceState *dev);
a575c5
-bool virtio_scsi_handle_cmd_vq(VirtIOSCSI *s, VirtQueue *vq);
a575c5
 void virtio_scsi_init_req(VirtIOSCSI *s, VirtQueue *vq, VirtIOSCSIReq *req);
a575c5
 void virtio_scsi_free_req(VirtIOSCSIReq *req);
a575c5
 void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev,