From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] kvm: x86: remove unused but set variable Date: Wed, 9 Nov 2016 00:17:12 +0100 Message-ID: <6884be2e-b98e-af72-ef4a-6cc06363d591@redhat.com> References: <1478480236-26038-1-git-send-email-jiang.biao2@zte.com.cn> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: rkrcmar@redhat.com, zhong.weidong@zte.com.cn To: Jiang Biao , kvm@vger.kernel.org Return-path: Received: from mail-wm0-f67.google.com ([74.125.82.67]:36405 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752646AbcKHXRR (ORCPT ); Tue, 8 Nov 2016 18:17:17 -0500 Received: by mail-wm0-f67.google.com with SMTP id c17so25671674wmc.3 for ; Tue, 08 Nov 2016 15:17:16 -0800 (PST) In-Reply-To: <1478480236-26038-1-git-send-email-jiang.biao2@zte.com.cn> Sender: kvm-owner@vger.kernel.org List-ID: 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 > --- > 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