@samitouri / QOSamiQemu / commits / 4801e50cf1

vhost: vhost_virtqueue_start(): drop extra local variables

One letter named variables doesn't really help to read the code, and they simply duplicate structure fields. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Reviewed-by: Raphael Norwitz <raphael.s.norwitz@gmail.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20260420200339.708640-15-vsementsov@yandex-team.ru>

Vladimir Sementsov-Ogievskiy committed Apr 20, 2026 at 23:03 UTC 4801e50cf1af17ffdd80b4b01b3f57581c9b91cc
1 file changed +3 -10
hw/virtio/vhost.c
+3 -10
@@ -1277,7 +1277,6 @@ int vhost_virtqueue_start(struct vhost_dev *dev,
1277 BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev)));
1278 VirtioBusState *vbus = VIRTIO_BUS(qbus);
1279 VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus);
1280 - hwaddr l;
1280 int r;
1281 int vhost_vq_index = dev->vhost_ops->vhost_get_vq_index(dev, idx);
1282 struct vhost_vring_file file = {
@@ -1302,23 +1301,17 @@ int vhost_virtqueue_start(struct vhost_dev *dev,
1301 /* Queue might not be ready for start */
1302 return 0;
1303 }
1305 -
1306 - l = vq->desc_size;
1307 - vq->desc = vhost_memory_map(dev, vq->desc_phys, l, false);
1304 + vq->desc = vhost_memory_map(dev, vq->desc_phys, vq->desc_size, false);
1305 if (!vq->desc) {
1306 r = -ENOMEM;
1307 goto fail;
1308 }
1312 -
1313 - l = vq->avail_size;
1314 - vq->avail = vhost_memory_map(dev, vq->avail_phys, l, false);
1309 + vq->avail = vhost_memory_map(dev, vq->avail_phys, vq->avail_size, false);
1310 if (!vq->avail) {
1311 r = -ENOMEM;
1312 goto fail;
1313 }
1319 -
1320 - l = vq->used_size;
1321 - vq->used = vhost_memory_map(dev, vq->used_phys, l, true);
1314 + vq->used = vhost_memory_map(dev, vq->used_phys, vq->used_size, true);
1315 if (!vq->used) {
1316 r = -ENOMEM;
1317 goto fail;