aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/virtio_console.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/virtio_console.c')
-rw-r--r--drivers/char/virtio_console.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c
index c74dacfa6795..0d328b59568d 100644
--- a/drivers/char/virtio_console.c
+++ b/drivers/char/virtio_console.c
@@ -31,6 +31,7 @@
31#include <linux/err.h> 31#include <linux/err.h>
32#include <linux/init.h> 32#include <linux/init.h>
33#include <linux/virtio.h> 33#include <linux/virtio.h>
34#include <linux/virtio_ids.h>
34#include <linux/virtio_console.h> 35#include <linux/virtio_console.h>
35#include "hvc_console.h" 36#include "hvc_console.h"
36 37
@@ -65,7 +66,7 @@ static int put_chars(u32 vtermno, const char *buf, int count)
65 66
66 /* add_buf wants a token to identify this buffer: we hand it any 67 /* add_buf wants a token to identify this buffer: we hand it any
67 * non-NULL pointer, since there's only ever one buffer. */ 68 * non-NULL pointer, since there's only ever one buffer. */
68 if (out_vq->vq_ops->add_buf(out_vq, sg, 1, 0, (void *)1) == 0) { 69 if (out_vq->vq_ops->add_buf(out_vq, sg, 1, 0, (void *)1) >= 0) {
69 /* Tell Host to go! */ 70 /* Tell Host to go! */
70 out_vq->vq_ops->kick(out_vq); 71 out_vq->vq_ops->kick(out_vq);
71 /* Chill out until it's done with the buffer. */ 72 /* Chill out until it's done with the buffer. */
@@ -85,7 +86,7 @@ static void add_inbuf(void)
85 sg_init_one(sg, inbuf, PAGE_SIZE); 86 sg_init_one(sg, inbuf, PAGE_SIZE);
86 87
87 /* We should always be able to add one buffer to an empty queue. */ 88 /* We should always be able to add one buffer to an empty queue. */
88 if (in_vq->vq_ops->add_buf(in_vq, sg, 0, 1, inbuf) != 0) 89 if (in_vq->vq_ops->add_buf(in_vq, sg, 0, 1, inbuf) < 0)
89 BUG(); 90 BUG();
90 in_vq->vq_ops->kick(in_vq); 91 in_vq->vq_ops->kick(in_vq);
91} 92}