From ff2683c53f448fb2d956aaaffa118d3d288f86a7 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Wed, 14 Sep 2011 13:06:45 +0530 Subject: [PATCH] --- yaml --- r: 273212 b: refs/heads/master c: 2d24cdaa6e389f85dad51eda39f1c2684a4f15b0 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/char/virtio_console.c | 15 +++++---------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index eddca7950f97..7bc3338647cb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ce072a0cee420782ed0a079ac17c7ca26056fb95 +refs/heads/master: 2d24cdaa6e389f85dad51eda39f1c2684a4f15b0 diff --git a/trunk/drivers/char/virtio_console.c b/trunk/drivers/char/virtio_console.c index 0538425e9a71..105181c1e6be 100644 --- a/trunk/drivers/char/virtio_console.c +++ b/trunk/drivers/char/virtio_console.c @@ -386,28 +386,23 @@ static int add_inbuf(struct virtqueue *vq, struct port_buffer *buf) static void discard_port_data(struct port *port) { struct port_buffer *buf; - struct virtqueue *vq; - unsigned int len, err; + unsigned int err; if (!port->portdev) { /* Device has been unplugged. vqs are already gone. */ return; } - vq = port->in_vq; - if (port->inbuf) - buf = port->inbuf; - else - buf = virtqueue_get_buf(vq, &len); + buf = get_inbuf(port); err = 0; while (buf) { - if (add_inbuf(vq, buf) < 0) { + if (add_inbuf(port->in_vq, buf) < 0) { err++; free_buf(buf); } - buf = virtqueue_get_buf(vq, &len); + port->inbuf = NULL; + buf = get_inbuf(port); } - port->inbuf = NULL; if (err) dev_warn(port->dev, "Errors adding %d buffers back to vq\n", err);