diff options
author | Amit Shah <amit.shah@redhat.com> | 2010-05-20 00:15:49 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-05-19 08:45:50 -0400 |
commit | 60caacd3eeab68672961e88db01e26735527d521 (patch) | |
tree | 687dc4dcc2fac6cce97ba8347abb88fccee95a15 /drivers/char | |
parent | 1d05160be743c506b1d6926e7c637496fa750cd3 (diff) |
virtio: console: Rename wait_is_over() to will_read_block()
We'll introduce a function that checks if write will block. Have
function names that are similar for the two cases.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/virtio_console.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 6207e3729923..a39bf191da02 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -479,9 +479,9 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count, | |||
479 | } | 479 | } |
480 | 480 | ||
481 | /* The condition that must be true for polling to end */ | 481 | /* The condition that must be true for polling to end */ |
482 | static bool wait_is_over(struct port *port) | 482 | static bool will_read_block(struct port *port) |
483 | { | 483 | { |
484 | return port_has_data(port) || !port->host_connected; | 484 | return !port_has_data(port) && port->host_connected; |
485 | } | 485 | } |
486 | 486 | ||
487 | static ssize_t port_fops_read(struct file *filp, char __user *ubuf, | 487 | static ssize_t port_fops_read(struct file *filp, char __user *ubuf, |
@@ -504,7 +504,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf, | |||
504 | return -EAGAIN; | 504 | return -EAGAIN; |
505 | 505 | ||
506 | ret = wait_event_interruptible(port->waitqueue, | 506 | ret = wait_event_interruptible(port->waitqueue, |
507 | wait_is_over(port)); | 507 | !will_read_block(port)); |
508 | if (ret < 0) | 508 | if (ret < 0) |
509 | return ret; | 509 | return ret; |
510 | } | 510 | } |