diff mbox series

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

Message ID 1575710723-32094-7-git-send-email-linmiaohe@huawei.com (mailing list archive)
State New, archived
Headers show
Series remove unnecessary return val of kvm pit | expand

Commit Message

Miaohe Lin Dec. 7, 2019, 9:25 a.m. UTC
From: Miaohe Lin <linmiaohe@huawei.com>

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@huawei.com>
---
 arch/x86/kvm/x86.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

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: