[PATCH 1/2] arm64/kvm: Drop unnecessary check in kvm_vcpu_preferred_target()

From: Gavin Shan
Date: Tue Aug 25 2020 - 02:19:23 EST


Since commit <bca556ac468a> ("arm64/kvm: Add generic v8 KVM target"),
there is no negative number returned from kvm_target_cpu(). So it's
not needed to validate its return value in kvm_vcpu_preferred_target()
and this just drops the unnecessary check.

Signed-off-by: Gavin Shan <gshan@xxxxxxxxxx>
---
arch/arm64/kvm/guest.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c
index dfb5218137ca..2365449ea32e 100644
--- a/arch/arm64/kvm/guest.c
+++ b/arch/arm64/kvm/guest.c
@@ -835,9 +835,6 @@ int kvm_vcpu_preferred_target(struct kvm_vcpu_init *init)
{
int target = kvm_target_cpu();

- if (target < 0)
- return -ENODEV;
-
memset(init, 0, sizeof(*init));

/*
--
2.23.0