[PATCH 6/6] KVM: x86: remove always equal to 0 return val of kvm_vm_ioctl_reinject()

From: linmiaohe
Date: Sat Dec 07 2019 - 04:26:07 EST


From: Miaohe Lin <linmiaohe@xxxxxxxxxx>

The return val of kvm_vm_ioctl_reinject() is always equal to 0, which means
there is no way to failed with this function. So remove the return val as
it's unnecessary to check against it.

Signed-off-by: Miaohe Lin <linmiaohe@xxxxxxxxxx>
---
arch/x86/kvm/x86.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 00b5d4ace383..82b0403cb2c7 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4657,7 +4657,7 @@ static void kvm_vm_ioctl_set_pit2(struct kvm *kvm, struct kvm_pit_state2 *ps)
mutex_unlock(&pit->pit_state.lock);
}

-static int kvm_vm_ioctl_reinject(struct kvm *kvm,
+static void kvm_vm_ioctl_reinject(struct kvm *kvm,
struct kvm_reinject_control *control)
{
struct kvm_pit *pit = kvm->arch.vpit;
@@ -4669,8 +4669,6 @@ static int kvm_vm_ioctl_reinject(struct kvm *kvm,
mutex_lock(&pit->pit_state.lock);
kvm_pit_set_reinject(pit, control->pit_reinject);
mutex_unlock(&pit->pit_state.lock);
-
- return 0;
}

/**
@@ -5029,7 +5027,8 @@ long kvm_arch_vm_ioctl(struct file *filp,
r = -ENXIO;
if (!kvm->arch.vpit)
goto out;
- r = kvm_vm_ioctl_reinject(kvm, &control);
+ kvm_vm_ioctl_reinject(kvm, &control);
+ r = 0;
break;
}
case KVM_SET_BOOT_CPU_ID:
--
2.19.1