diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 12:23:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 12:23:45 -0400 |
commit | 1f0918d03ff4b5c94540c71ce889672abdbc2f4a (patch) | |
tree | ecee710444fb3405da55933501e339e10e4ac880 /drivers/char | |
parent | 4266c97a3ef4604561a22212eb0eab8a3c338971 (diff) | |
parent | ca60a42c9be41c07ebcc2ec8c43dd1be53f147bf (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus:
lguest: don't force VIRTIO_F_NOTIFY_ON_EMPTY
lguest: cleanup for map_switcher()
lguest: use PGDIR_SHIFT for PAE code to allow different PAGE_OFFSET
lguest: use set_pte/set_pmd uniformly for real page table entries
lguest: move panic notifier registration to its expected place.
virtio_blk: add support for cache flush
virtio: add virtio IDs file
virtio: get rid of redundant VIRTIO_ID_9P definition
virtio: make add_buf return capacity remaining
virtio_pci: minor MSI-X cleanups
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/hw_random/virtio-rng.c | 3 | ||||
-rw-r--r-- | drivers/char/virtio_console.c | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c index 32216b623248..962968f05b94 100644 --- a/drivers/char/hw_random/virtio-rng.c +++ b/drivers/char/hw_random/virtio-rng.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/scatterlist.h> | 21 | #include <linux/scatterlist.h> |
22 | #include <linux/spinlock.h> | 22 | #include <linux/spinlock.h> |
23 | #include <linux/virtio.h> | 23 | #include <linux/virtio.h> |
24 | #include <linux/virtio_ids.h> | ||
24 | #include <linux/virtio_rng.h> | 25 | #include <linux/virtio_rng.h> |
25 | 26 | ||
26 | /* The host will fill any buffer we give it with sweet, sweet randomness. We | 27 | /* The host will fill any buffer we give it with sweet, sweet randomness. We |
@@ -51,7 +52,7 @@ static void register_buffer(void) | |||
51 | 52 | ||
52 | sg_init_one(&sg, random_data+data_left, RANDOM_DATA_SIZE-data_left); | 53 | sg_init_one(&sg, random_data+data_left, RANDOM_DATA_SIZE-data_left); |
53 | /* There should always be room for one buffer. */ | 54 | /* There should always be room for one buffer. */ |
54 | if (vq->vq_ops->add_buf(vq, &sg, 0, 1, random_data) != 0) | 55 | if (vq->vq_ops->add_buf(vq, &sg, 0, 1, random_data) < 0) |
55 | BUG(); | 56 | BUG(); |
56 | vq->vq_ops->kick(vq); | 57 | vq->vq_ops->kick(vq); |
57 | } | 58 | } |
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 | } |