linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] KVM: vmx: remove unreachable statement in vmx_get_msr_feature()
@ 2019-12-06  3:41 linmiaohe
  2019-12-06  9:58 ` Paolo Bonzini
  0 siblings, 1 reply; 8+ messages in thread
From: linmiaohe @ 2019-12-06  3:41 UTC (permalink / raw)
  To: Wanpeng Li
  Cc: Liran Alon, pbonzini, rkrcmar, sean.j.christopherson, vkuznets,
	wanpengli, jmattson, joro, tglx, mingo, bp, hpa, kvm,
	linux-kernel, x86

Wanpeng Li <kernellwp@gmail.com> wrote:
>>
>> >
>> >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.
>> >
>> Yes. As what " Turnip greens, all have love " said. ^_^
>
>Actually it is a great appreciated to introduce something more useful instead of tons of cleanups, I saw guys did one cleanup and can incur several bugs before.
>
I'd like to introduce something more useful, but side corner cleanups may be hard to
found out something to introduce. And such cleanups can also be validated by code inspection
to avoid something bad. Many thanks.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] KVM: vmx: remove unreachable statement in vmx_get_msr_feature()
  2019-12-06  3:41 [PATCH] KVM: vmx: remove unreachable statement in vmx_get_msr_feature() linmiaohe
@ 2019-12-06  9:58 ` Paolo Bonzini
  0 siblings, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2019-12-06  9:58 UTC (permalink / raw)
  To: linmiaohe, Wanpeng Li
  Cc: Liran Alon, rkrcmar, sean.j.christopherson, vkuznets, wanpengli,
	jmattson, joro, tglx, mingo, bp, hpa, kvm, linux-kernel, x86

On 06/12/19 04:41, linmiaohe wrote:
> Wanpeng Li <kernellwp@gmail.com> wrote:
>>>
>>>>
>>>> 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.
>>>>
>>> Yes. As what " Turnip greens, all have love " said. ^_^
>>
>> Actually it is a great appreciated to introduce something more useful instead of tons of cleanups, I saw guys did one cleanup and can incur several bugs before.
>>
> I'd like to introduce something more useful, but side corner cleanups may be hard to
> found out something to introduce. And such cleanups can also be validated by code inspection
> to avoid something bad. Many thanks.
> 

Yeah, I think you have been doing a good job.  Usually, when the
cleanups introduce bugs there are many other "suspicious" things.  For
me it's clear that you're learning the code and not just messing around.

Paolo


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] KVM: vmx: remove unreachable statement in vmx_get_msr_feature()
@ 2019-12-07  6:53 linmiaohe
  0 siblings, 0 replies; 8+ messages in thread
From: linmiaohe @ 2019-12-07  6:53 UTC (permalink / raw)
  To: Paolo Bonzini, Wanpeng Li
  Cc: Liran Alon, rkrcmar, sean.j.christopherson, vkuznets, wanpengli,
	jmattson, joro, tglx, mingo, bp, hpa, kvm, linux-kernel, x86


Paolo Bonzini <pbonzini@redhat.com> wrote:
>> Wanpeng Li <kernellwp@gmail.com> wrote:
>>>>
>>>>>
>>>>> 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.
>>>>>
>>>> Yes. As what " Turnip greens, all have love " said. ^_^
>>>
>>> Actually it is a great appreciated to introduce something more useful instead of tons of cleanups, I saw guys did one cleanup and can incur several bugs before.
>>>
>> I'd like to introduce something more useful, but side corner cleanups 
>> may be hard to found out something to introduce. And such cleanups can 
>> also be validated by code inspection to avoid something bad. Many thanks.
>> 
>
>Yeah, I think you have been doing a good job.  Usually, when the cleanups introduce bugs there are many other "suspicious" things.  For me it's clear that you're learning the code and not just messing around.
>
>Paolo

Many thanks for your approve. I really feel grateful for it. In fact, I am investigating the
code and expect a deep understanding. But it's really a enormous, sophisticated and
wonderful world, what I can do now is try to keep the code clean. Maybe I could introduce some useful
features someday. Many thanks again.

Best wishes.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] KVM: vmx: remove unreachable statement in vmx_get_msr_feature()
  2019-12-06  1:53 linmiaohe
@ 2019-12-06  3:10 ` Wanpeng Li
  0 siblings, 0 replies; 8+ messages in thread
From: Wanpeng Li @ 2019-12-06  3:10 UTC (permalink / raw)
  To: linmiaohe
  Cc: Liran Alon, pbonzini, rkrcmar, sean.j.christopherson, vkuznets,
	wanpengli, jmattson, joro, tglx, mingo, bp, hpa, kvm,
	linux-kernel, x86

On Fri, 6 Dec 2019 at 09:54, linmiaohe <linmiaohe@huawei.com> wrote:
>
> >
> >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.
> >
> Yes. As what " Turnip greens, all have love " said. ^_^

Actually it is a great appreciated to introduce something more useful
instead of tons of cleanups, I saw guys did one cleanup and can incur
several bugs before.

    Wanpeng

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] KVM: vmx: remove unreachable statement in vmx_get_msr_feature()
@ 2019-12-06  1:53 linmiaohe
  2019-12-06  3:10 ` Wanpeng Li
  0 siblings, 1 reply; 8+ messages in thread
From: linmiaohe @ 2019-12-06  1:53 UTC (permalink / raw)
  To: Liran Alon
  Cc: pbonzini, rkrcmar, sean.j.christopherson, vkuznets, wanpengli,
	jmattson, joro, tglx, mingo, bp, hpa, kvm, linux-kernel, x86

>
>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.
>
Yes. As what " Turnip greens, all have love " said. ^_^

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] KVM: vmx: remove unreachable statement in vmx_get_msr_feature()
  2019-12-05  2:24 linmiaohe
  2019-12-05 10:17 ` Paolo Bonzini
@ 2019-12-05 13:43 ` Liran Alon
  1 sibling, 0 replies; 8+ messages in thread
From: Liran Alon @ 2019-12-05 13:43 UTC (permalink / raw)
  To: linmiaohe
  Cc: pbonzini, rkrcmar, sean.j.christopherson, vkuznets, wanpengli,
	jmattson, joro, tglx, mingo, bp, hpa, kvm, linux-kernel, x86



> 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.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] KVM: vmx: remove unreachable statement in vmx_get_msr_feature()
  2019-12-05  2:24 linmiaohe
@ 2019-12-05 10:17 ` Paolo Bonzini
  2019-12-05 13:43 ` Liran Alon
  1 sibling, 0 replies; 8+ messages in thread
From: Paolo Bonzini @ 2019-12-05 10:17 UTC (permalink / raw)
  To: linmiaohe, rkrcmar, sean.j.christopherson, vkuznets, wanpengli,
	jmattson, joro, tglx, mingo, bp, hpa
  Cc: kvm, linux-kernel, x86

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] KVM: vmx: remove unreachable statement in vmx_get_msr_feature()
@ 2019-12-05  2:24 linmiaohe
  2019-12-05 10:17 ` Paolo Bonzini
  2019-12-05 13:43 ` Liran Alon
  0 siblings, 2 replies; 8+ messages in thread
From: linmiaohe @ 2019-12-05  2:24 UTC (permalink / raw)
  To: pbonzini, rkrcmar, sean.j.christopherson, vkuznets, wanpengli,
	jmattson, joro, tglx, mingo, bp, hpa
  Cc: linmiaohe, kvm, linux-kernel, x86

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;
 }
 
 /*
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-12-07  6:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06  3:41 [PATCH] KVM: vmx: remove unreachable statement in vmx_get_msr_feature() linmiaohe
2019-12-06  9:58 ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2019-12-07  6:53 linmiaohe
2019-12-06  1:53 linmiaohe
2019-12-06  3:10 ` Wanpeng Li
2019-12-05  2:24 linmiaohe
2019-12-05 10:17 ` Paolo Bonzini
2019-12-05 13:43 ` Liran Alon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).