[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] hw: virtio-gpu: remove duplicated 'virtqueue_pop'
From: |
Li Qiang |
Subject: |
[PATCH] hw: virtio-gpu: remove duplicated 'virtqueue_pop' |
Date: |
Thu, 13 Aug 2020 08:36:14 -0700 |
Just use 'while (true)' to avoid duplicated.
No function change.
Signed-off-by: Li Qiang <liq3ea@163.com>
---
hw/display/virtio-gpu.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 5f0dd7c150..9cef313f5e 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -869,13 +869,15 @@ static void virtio_gpu_handle_ctrl(VirtIODevice *vdev,
VirtQueue *vq)
}
#endif
- cmd = virtqueue_pop(vq, sizeof(struct virtio_gpu_ctrl_command));
- while (cmd) {
+ while (true) {
+ cmd = virtqueue_pop(vq, sizeof(struct virtio_gpu_ctrl_command));
+ if (!cmd) {
+ break;
+ }
cmd->vq = vq;
cmd->error = 0;
cmd->finished = false;
QTAILQ_INSERT_TAIL(&g->cmdq, cmd, next);
- cmd = virtqueue_pop(vq, sizeof(struct virtio_gpu_ctrl_command));
}
virtio_gpu_process_cmdq(g);
--
2.17.1
- [PATCH] hw: virtio-gpu: remove duplicated 'virtqueue_pop',
Li Qiang <=