Module Name: src
Committed By: yamaguchi
Date: Wed Apr 19 00:40:30 UTC 2023
Modified Files:
src/sys/dev/pci: virtio.c
Log Message:
virtio(4): change variable name, nfc
To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/pci/virtio.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/virtio.c
diff -u src/sys/dev/pci/virtio.c:1.76 src/sys/dev/pci/virtio.c:1.77
--- src/sys/dev/pci/virtio.c:1.76 Wed Apr 19 00:38:30 2023
+++ src/sys/dev/pci/virtio.c Wed Apr 19 00:40:30 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio.c,v 1.76 2023/04/19 00:38:30 yamaguchi Exp $ */
+/* $NetBSD: virtio.c,v 1.77 2023/04/19 00:40:30 yamaguchi Exp $ */
/*
* Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.76 2023/04/19 00:38:30 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.77 2023/04/19 00:40:30 yamaguchi Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -944,12 +944,12 @@ vq_alloc_slot_locked(struct virtio_softc
size_t nslots)
{
struct vring_desc *vd;
- uint16_t rv, tail;
+ uint16_t head, tail;
size_t i;
KASSERT(mutex_owned(&vq->vq_freedesc_lock));
- tail = virtio_rw16(sc, vq->vq_free_idx);
+ head = tail = virtio_rw16(sc, vq->vq_free_idx);
for (i = 0; i < nslots - 1; i++) {
if (tail == VRING_DESC_CHAIN_END)
return VRING_DESC_CHAIN_END;
@@ -962,13 +962,11 @@ vq_alloc_slot_locked(struct virtio_softc
if (tail == VRING_DESC_CHAIN_END)
return VRING_DESC_CHAIN_END;
- rv = virtio_rw16(sc, vq->vq_free_idx);
-
vd = &vq->vq_desc[tail];
vd->flags = virtio_rw16(sc, 0);
vq->vq_free_idx = vd->next;
- return rv;
+ return head;
}
static uint16_t
vq_alloc_slot(struct virtio_softc *sc, struct virtqueue *vq, size_t nslots)