Skip to content

Commit ce072a0

Browse files
amit3srustyrussell
authored andcommitted
virtio: console: rename variable
'ret' is a misnomer in discard_port_data() since we don't return the value. Rename it to 'err'. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent d25a9dd commit ce072a0

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

‎drivers/char/virtio_console.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,7 @@ static void discard_port_data(struct port *port)
387387
{
388388
struct port_buffer *buf;
389389
struct virtqueue *vq;
390-
unsigned int len;
391-
int ret;
390+
unsigned int len, err;
392391

393392
if (!port->portdev) {
394393
/* Device has been unplugged. vqs are already gone. */
@@ -400,18 +399,18 @@ static void discard_port_data(struct port *port)
400399
else
401400
buf = virtqueue_get_buf(vq, &len);
402401

403-
ret = 0;
402+
err = 0;
404403
while (buf) {
405404
if (add_inbuf(vq, buf) < 0) {
406-
ret++;
405+
err++;
407406
free_buf(buf);
408407
}
409408
buf = virtqueue_get_buf(vq, &len);
410409
}
411410
port->inbuf = NULL;
412-
if (ret)
411+
if (err)
413412
dev_warn(port->dev, "Errors adding %d buffers back to vq\n",
414-
ret);
413+
err);
415414
}
416415

417416
static bool port_has_data(struct port *port)

0 commit comments

Comments
 (0)