diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-09-23 22:26:31 -0600 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-09-23 22:26:31 +0930 |
commit | 3c1b27d5043086a485f8526353ae9fe37bfa1065 (patch) | |
tree | e3b6eda3c66bcd1fc3af6e7fa6e4e3af77459474 /drivers/char/hw_random | |
parent | f68d24082e22ccee3077d11aeb6dc5354f0ca7f1 (diff) | |
download | blackbird-op-linux-3c1b27d5043086a485f8526353ae9fe37bfa1065.tar.gz blackbird-op-linux-3c1b27d5043086a485f8526353ae9fe37bfa1065.zip |
virtio: make add_buf return capacity remaining
This API change means that virtio_net can tell how much capacity
remains for buffers. It's necessarily fuzzy, since
VIRTIO_RING_F_INDIRECT_DESC means we can fit any number of descriptors
in one, *if* we can kmalloc.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Dinesh Subhraveti <dineshs@us.ibm.com>
Diffstat (limited to 'drivers/char/hw_random')
-rw-r--r-- | drivers/char/hw_random/virtio-rng.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c index 32216b623248..b6c24dcc987d 100644 --- a/drivers/char/hw_random/virtio-rng.c +++ b/drivers/char/hw_random/virtio-rng.c @@ -51,7 +51,7 @@ static void register_buffer(void) sg_init_one(&sg, random_data+data_left, RANDOM_DATA_SIZE-data_left); /* There should always be room for one buffer. */ - if (vq->vq_ops->add_buf(vq, &sg, 0, 1, random_data) != 0) + if (vq->vq_ops->add_buf(vq, &sg, 0, 1, random_data) < 0) BUG(); vq->vq_ops->kick(vq); } |