diff options
author | Andrew Scull <ascull@google.com> | 2022-05-16 13:41:29 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-06-08 16:24:03 +0300 |
commit | 68f8bf21c72515adcdd41ac6f8dbebb29259aeb7 (patch) | |
tree | 7cfb5cb209b4221cdba3e634a18bc61fbc83a9a1 /drivers/virtio | |
parent | ed1cbbe2afe4d4c7c25316db4c2e15c4c579fc4e (diff) | |
download | u-boot-68f8bf21c72515adcdd41ac6f8dbebb29259aeb7.tar.xz |
virtio_ring: Merge identical variables
The variables `total_sg` and `descs_used` have the same value. Replace
the few uses of `total_sg` with `descs_used` to simplify the situation.
Signed-off-by: Andrew Scull <ascull@google.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'drivers/virtio')
-rw-r--r-- | drivers/virtio/virtio_ring.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 7f1cbc5932..a6922ce1b8 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -20,17 +20,16 @@ int virtqueue_add(struct virtqueue *vq, struct virtio_sg *sgs[], unsigned int out_sgs, unsigned int in_sgs) { struct vring_desc *desc; - unsigned int total_sg = out_sgs + in_sgs; - unsigned int i, n, avail, descs_used, uninitialized_var(prev); + unsigned int descs_used = out_sgs + in_sgs; + unsigned int i, n, avail, uninitialized_var(prev); int head; - WARN_ON(total_sg == 0); + WARN_ON(descs_used == 0); head = vq->free_head; desc = vq->vring.desc; i = head; - descs_used = total_sg; if (vq->num_free < descs_used) { debug("Can't add buf len %i - avail = %i\n", |