diff mbox series

KVM: vmx: remove unreachable statement in vmx_get_msr_feature()

Message ID 1575512678-22058-1-git-send-email-linmiaohe@huawei.com (mailing list archive)
State New, archived
Headers show
Series KVM: vmx: remove unreachable statement in vmx_get_msr_feature() | expand

Commit Message

Miaohe Lin Dec. 5, 2019, 2:24 a.m. UTC
From: Miaohe Lin <linmiaohe@huawei.com>

We have no way to reach the final statement, remove it.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 arch/x86/kvm/vmx/vmx.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Paolo Bonzini Dec. 5, 2019, 10:17 a.m. UTC | #1
On 05/12/19 03:24, linmiaohe wrote:
> From: Miaohe Lin <linmiaohe@huawei.com>
> 
> We have no way to reach the final statement, remove it.
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  arch/x86/kvm/vmx/vmx.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index e7ea332ad1e8..e58a0daf0f86 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -1781,8 +1781,6 @@ static int vmx_get_msr_feature(struct kvm_msr_entry *msr)
>  	default:
>  		return 1;
>  	}
> -
> -	return 0;
>  }
>  
>  /*
> 

Queued, thanks.

Paolo
Liran Alon Dec. 5, 2019, 1:43 p.m. UTC | #2
> On 5 Dec 2019, at 4:24, linmiaohe <linmiaohe@huawei.com> wrote:
> 
> From: Miaohe Lin <linmiaohe@huawei.com>
> 
> We have no way to reach the final statement, remove it.
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
> arch/x86/kvm/vmx/vmx.c | 2 --
> 1 file changed, 2 deletions(-)
> 
> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
> index e7ea332ad1e8..e58a0daf0f86 100644
> --- a/arch/x86/kvm/vmx/vmx.c
> +++ b/arch/x86/kvm/vmx/vmx.c
> @@ -1781,8 +1781,6 @@ static int vmx_get_msr_feature(struct kvm_msr_entry *msr)
> 	default:
> 		return 1;
> 	}
> -
> -	return 0;
> }

I personally just prefer to remove the “default” case and change this “return 0;” to “return 1;”.
But it’s a matter of taste of course.
diff mbox series

Patch

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index e7ea332ad1e8..e58a0daf0f86 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -1781,8 +1781,6 @@  static int vmx_get_msr_feature(struct kvm_msr_entry *msr)
 	default:
 		return 1;
 	}
-
-	return 0;
 }
 
 /*