[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1575710723-32094-7-git-send-email-linmiaohe@huawei.com>
Date: Sat, 7 Dec 2019 17:25:23 +0800
From: linmiaohe <linmiaohe@...wei.com>
To: <pbonzini@...hat.com>, <rkrcmar@...hat.com>,
<sean.j.christopherson@...el.com>, <vkuznets@...hat.com>,
<wanpengli@...cent.com>, <jmattson@...gle.com>, <joro@...tes.org>,
<tglx@...utronix.de>, <mingo@...hat.com>, <bp@...en8.de>,
<hpa@...or.com>
CC: <linmiaohe@...wei.com>, <kvm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <x86@...nel.org>
Subject: [PATCH 6/6] KVM: x86: remove always equal to 0 return val of kvm_vm_ioctl_reinject()
From: Miaohe Lin <linmiaohe@...wei.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@...wei.com>
---
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
Powered by blists - more mailing lists