virtio: console: Rename wait_is_over() to will_read_block()
authorAmit Shah <amit.shah@redhat.com>
Thu, 20 May 2010 04:15:49 +0000 (22:15 -0600)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 19 May 2010 12:45:50 +0000 (22:15 +0930)
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>
drivers/char/virtio_console.c

index 6207e372992382e93cc3941bbdfd47fa2c3c8b72..a39bf191da02d8680b77591b83d98d37a52b8844 100644 (file)
@@ -479,9 +479,9 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count,
 }
 
 /* The condition that must be true for polling to end */
-static bool wait_is_over(struct port *port)
+static bool will_read_block(struct port *port)
 {
-       return port_has_data(port) || !port->host_connected;
+       return !port_has_data(port) && port->host_connected;
 }
 
 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,
                        return -EAGAIN;
 
                ret = wait_event_interruptible(port->waitqueue,
-                                              wait_is_over(port));
+                                              !will_read_block(port));
                if (ret < 0)
                        return ret;
        }