Skip to content

Commit 896fc24

Browse files
Yunsheng Linmstsirkin
authored andcommitted
vhost: Remove unnecessary variable
It is unnecessary to use ret variable to return the error code, just return the error code directly. Signed-off-by: Yunsheng Lin <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 718be6b commit 896fc24

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/vhost/vhost.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ EXPORT_SYMBOL_GPL(vhost_poll_init);
203203
int vhost_poll_start(struct vhost_poll *poll, struct file *file)
204204
{
205205
__poll_t mask;
206-
int ret = 0;
207206

208207
if (poll->wqh)
209208
return 0;
@@ -213,10 +212,10 @@ int vhost_poll_start(struct vhost_poll *poll, struct file *file)
213212
vhost_poll_wakeup(&poll->wait, 0, 0, poll_to_key(mask));
214213
if (mask & EPOLLERR) {
215214
vhost_poll_stop(poll);
216-
ret = -EINVAL;
215+
return -EINVAL;
217216
}
218217

219-
return ret;
218+
return 0;
220219
}
221220
EXPORT_SYMBOL_GPL(vhost_poll_start);
222221

0 commit comments

Comments
 (0)