Skip to content

Commit

Permalink
vhost: Remove unnecessary variable
Browse files Browse the repository at this point in the history
It is unnecessary to use ret variable to return the error
code, just return the error code directly.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Yunsheng Lin authored and Michael S. Tsirkin committed Sep 4, 2019
1 parent 718be6b commit 896fc24
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/vhost/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ EXPORT_SYMBOL_GPL(vhost_poll_init);
int vhost_poll_start(struct vhost_poll *poll, struct file *file)
{
__poll_t mask;
int ret = 0;

if (poll->wqh)
return 0;
Expand All @@ -213,10 +212,10 @@ int vhost_poll_start(struct vhost_poll *poll, struct file *file)
vhost_poll_wakeup(&poll->wait, 0, 0, poll_to_key(mask));
if (mask & EPOLLERR) {
vhost_poll_stop(poll);
ret = -EINVAL;
return -EINVAL;
}

return ret;
return 0;
}
EXPORT_SYMBOL_GPL(vhost_poll_start);

Expand Down

0 comments on commit 896fc24

Please sign in to comment.