Commit 60caacd3 authored by Amit Shah's avatar Amit Shah Committed by Rusty Russell

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: default avatarAmit Shah <amit.shah@redhat.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 1d05160b
...@@ -479,9 +479,9 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count, ...@@ -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 */ /* 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, 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,7 +504,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf,
return -EAGAIN; return -EAGAIN;
ret = wait_event_interruptible(port->waitqueue, ret = wait_event_interruptible(port->waitqueue,
wait_is_over(port)); !will_read_block(port));
if (ret < 0) if (ret < 0)
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment