Skip to content

Commit 6cf9ef2

Browse files
committed
KVM: Return '0' directly when there's no task to yield to
Do "return 0" instead of initializing and returning a local variable in kvm_vcpu_yield_to(), e.g. so that it's more obvious what the function returns if there is no task. No functional change intended. Acked-by: Oliver Upton <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent 7e51361 commit 6cf9ef2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

virt/kvm/kvm_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3772,15 +3772,15 @@ int kvm_vcpu_yield_to(struct kvm_vcpu *target)
37723772
{
37733773
struct pid *pid;
37743774
struct task_struct *task = NULL;
3775-
int ret = 0;
3775+
int ret;
37763776

37773777
rcu_read_lock();
37783778
pid = rcu_dereference(target->pid);
37793779
if (pid)
37803780
task = get_pid_task(pid, PIDTYPE_PID);
37813781
rcu_read_unlock();
37823782
if (!task)
3783-
return ret;
3783+
return 0;
37843784
ret = yield_to(task, 1);
37853785
put_task_struct(task);
37863786

0 commit comments

Comments
 (0)