Reviewed-by: Raphael Norwitz <raphael.s.norwitz@gmail.com>
On Mon, Jan 19, 2026 at 1:55 PM Vladimir Sementsov-Ogievskiy
<vsementsov@yandex-team.ru> wrote:
>
> 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>
> ---
> hw/virtio/vhost.c | 13 +++----------
> 1 file changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
> index 06b0b34cd3..653cb706cc 100644
> --- a/hw/virtio/vhost.c
> +++ b/hw/virtio/vhost.c
> @@ -1277,7 +1277,6 @@ int vhost_virtqueue_start(struct vhost_dev *dev,
> BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev)));
> VirtioBusState *vbus = VIRTIO_BUS(qbus);
> VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus);
> - hwaddr l;
> int r;
> int vhost_vq_index = dev->vhost_ops->vhost_get_vq_index(dev, idx);
> struct vhost_vring_file file = {
> @@ -1302,23 +1301,17 @@ int vhost_virtqueue_start(struct vhost_dev *dev,
> /* Queue might not be ready for start */
> return 0;
> }
> -
> - l = vq->desc_size;
> - vq->desc = vhost_memory_map(dev, vq->desc_phys, l, false);
> + vq->desc = vhost_memory_map(dev, vq->desc_phys, vq->desc_size, false);
> if (!vq->desc) {
> r = -ENOMEM;
> goto fail;
> }
> -
> - l = vq->avail_size;
> - vq->avail = vhost_memory_map(dev, vq->avail_phys, l, false);
> + vq->avail = vhost_memory_map(dev, vq->avail_phys, vq->avail_size, false);
> if (!vq->avail) {
> r = -ENOMEM;
> goto fail;
> }
> -
> - l = vq->used_size;
> - vq->used = vhost_memory_map(dev, vq->used_phys, l, true);
> + vq->used = vhost_memory_map(dev, vq->used_phys, vq->used_size, true);
> if (!vq->used) {
> r = -ENOMEM;
> goto fail;
> --
> 2.52.0
>
>