2015-05-08 15:47:09

by Nicholas Mc Guire

[permalink] [raw]
Subject: [PATCH] MIPS: KVM: fix unused variable build warning

As kvm_mips_complete_mmio_load() did not yet modify PC at this point
as James Hogans <[email protected]> explained the curr_pc variable
and the comments along with it can be dropped.

Signed-off-by: Nicholas Mc Guire <[email protected]>
Link: http://lkml.org/lkml/2015/5/8/422
---

buildwarning being fixed in -next-20150508:
arch/mips/kvm/emulate.c: In function 'kvm_mips_complete_mmio_load':
arch/mips/kvm/emulate.c:2392:16: warning: variable 'curr_pc' set but not
used [-Wunused-but-set-variable]

Patch was only compile tested msp71xx_defconfig + CONFIG_KVM=m

Patch is against 4.1-rc2 (localversion-next is -next-20150508)

arch/mips/kvm/emulate.c | 6 ------
1 file changed, 6 deletions(-)

diff --git a/arch/mips/kvm/emulate.c b/arch/mips/kvm/emulate.c
index 6230f37..4b50c57 100644
--- a/arch/mips/kvm/emulate.c
+++ b/arch/mips/kvm/emulate.c
@@ -2389,7 +2389,6 @@ enum emulation_result kvm_mips_complete_mmio_load(struct kvm_vcpu *vcpu,
{
unsigned long *gpr = &vcpu->arch.gprs[vcpu->arch.io_gpr];
enum emulation_result er = EMULATE_DONE;
- unsigned long curr_pc;

if (run->mmio.len > sizeof(*gpr)) {
kvm_err("Bad MMIO length: %d", run->mmio.len);
@@ -2397,11 +2396,6 @@ enum emulation_result kvm_mips_complete_mmio_load(struct kvm_vcpu *vcpu,
goto done;
}

- /*
- * Update PC and hold onto current PC in case there is
- * an error and we want to rollback the PC
- */
- curr_pc = vcpu->arch.pc;
er = update_pc(vcpu, vcpu->arch.pending_load_cause);
if (er == EMULATE_FAIL)
return er;
--
1.7.10.4