Commit ce072a0c authored by Amit Shah's avatar Amit Shah Committed by Rusty Russell

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: default avatarRusty Russell <rusty@rustcorp.com.au>
parent d25a9dda
...@@ -387,8 +387,7 @@ static void discard_port_data(struct port *port) ...@@ -387,8 +387,7 @@ static void discard_port_data(struct port *port)
{ {
struct port_buffer *buf; struct port_buffer *buf;
struct virtqueue *vq; struct virtqueue *vq;
unsigned int len; unsigned int len, err;
int ret;
if (!port->portdev) { if (!port->portdev) {
/* Device has been unplugged. vqs are already gone. */ /* Device has been unplugged. vqs are already gone. */
...@@ -400,18 +399,18 @@ static void discard_port_data(struct port *port) ...@@ -400,18 +399,18 @@ static void discard_port_data(struct port *port)
else else
buf = virtqueue_get_buf(vq, &len); buf = virtqueue_get_buf(vq, &len);
ret = 0; err = 0;
while (buf) { while (buf) {
if (add_inbuf(vq, buf) < 0) { if (add_inbuf(vq, buf) < 0) {
ret++; err++;
free_buf(buf); free_buf(buf);
} }
buf = virtqueue_get_buf(vq, &len); buf = virtqueue_get_buf(vq, &len);
} }
port->inbuf = NULL; port->inbuf = NULL;
if (ret) if (err)
dev_warn(port->dev, "Errors adding %d buffers back to vq\n", dev_warn(port->dev, "Errors adding %d buffers back to vq\n",
ret); err);
} }
static bool port_has_data(struct port *port) static bool port_has_data(struct port *port)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment