* [PATCH] kvm: x86: remove unused but set variable
@ 2016-11-07 0:57 Jiang Biao
2016-11-08 23:17 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Jiang Biao @ 2016-11-07 0:57 UTC (permalink / raw)
To: kvm; +Cc: pbonzini, rkrcmar, zhong.weidong, jiang.biao2
The local variable *gpa_offset* is set but not used afterwards,
which make the compiler issue a warning with option
-Wunused-but-set-variable. Remove it to avoid the warning.
Signed-off-by: Jiang Biao <jiang.biao2@zte.com.cn>
---
arch/x86/kvm/x86.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index cfd916c..a55d024 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2162,7 +2162,6 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
break;
case MSR_KVM_SYSTEM_TIME_NEW:
case MSR_KVM_SYSTEM_TIME: {
- u64 gpa_offset;
struct kvm_arch *ka = &vcpu->kvm->arch;
kvmclock_reset(vcpu);
@@ -2184,8 +2183,6 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
if (!(data & 1))
break;
- gpa_offset = data & ~(PAGE_MASK | 1);
-
if (kvm_gfn_to_hva_cache_init(vcpu->kvm,
&vcpu->arch.pv_time, data & ~1ULL,
sizeof(struct pvclock_vcpu_time_info)))
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] kvm: x86: remove unused but set variable
2016-11-07 0:57 [PATCH] kvm: x86: remove unused but set variable Jiang Biao
@ 2016-11-08 23:17 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2016-11-08 23:17 UTC (permalink / raw)
To: Jiang Biao, kvm; +Cc: rkrcmar, zhong.weidong
On 07/11/2016 01:57, Jiang Biao wrote:
> The local variable *gpa_offset* is set but not used afterwards,
> which make the compiler issue a warning with option
> -Wunused-but-set-variable. Remove it to avoid the warning.
>
> Signed-off-by: Jiang Biao <jiang.biao2@zte.com.cn>
> ---
> arch/x86/kvm/x86.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index cfd916c..a55d024 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -2162,7 +2162,6 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
> break;
> case MSR_KVM_SYSTEM_TIME_NEW:
> case MSR_KVM_SYSTEM_TIME: {
> - u64 gpa_offset;
> struct kvm_arch *ka = &vcpu->kvm->arch;
>
> kvmclock_reset(vcpu);
> @@ -2184,8 +2183,6 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
> if (!(data & 1))
> break;
>
> - gpa_offset = data & ~(PAGE_MASK | 1);
> -
> if (kvm_gfn_to_hva_cache_init(vcpu->kvm,
> &vcpu->arch.pv_time, data & ~1ULL,
> sizeof(struct pvclock_vcpu_time_info)))
>
Applied all four, thanks.
Paolo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-08 23:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-07 0:57 [PATCH] kvm: x86: remove unused but set variable Jiang Biao
2016-11-08 23:17 ` Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.