lkml.org 
[lkml]   [2021]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 13/17] virtio_input: Remove unused used length
Date
The used length is not used. Let's drop it and
pass NULL to virtqueue_get_buf() instead.

Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
---
drivers/virtio/virtio_input.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/virtio/virtio_input.c b/drivers/virtio/virtio_input.c
index ce51ae165943..f83f8e556fba 100644
--- a/drivers/virtio/virtio_input.c
+++ b/drivers/virtio/virtio_input.c
@@ -35,11 +35,10 @@ static void virtinput_recv_events(struct virtqueue *vq)
struct virtio_input *vi = vq->vdev->priv;
struct virtio_input_event *event;
unsigned long flags;
- unsigned int len;

spin_lock_irqsave(&vi->lock, flags);
if (vi->ready) {
- while ((event = virtqueue_get_buf(vi->evt, &len)) != NULL) {
+ while ((event = virtqueue_get_buf(vi->evt, NULL)) != NULL) {
spin_unlock_irqrestore(&vi->lock, flags);
input_event(vi->idev,
le16_to_cpu(event->type),
@@ -108,10 +107,9 @@ static void virtinput_recv_status(struct virtqueue *vq)
struct virtio_input *vi = vq->vdev->priv;
struct virtio_input_event *stsbuf;
unsigned long flags;
- unsigned int len;

spin_lock_irqsave(&vi->lock, flags);
- while ((stsbuf = virtqueue_get_buf(vi->sts, &len)) != NULL)
+ while ((stsbuf = virtqueue_get_buf(vi->sts, NULL)) != NULL)
kfree(stsbuf);
spin_unlock_irqrestore(&vi->lock, flags);
}
--
2.11.0
\
 
 \ /
  Last update: 2021-05-17 11:15    [W:0.164 / U:0.660 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site