Skip to contentSkip to conversation

kvm: remove unused variable 'vcpu_book3s'

PATCH Applied Geyslan G. Bem 3 participants 4 messages Dec 1, 2015 – Dec 10, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm: remove unused variable 'vcpu_book3s'

The vcpu_book3s struct is assigned but never used. So remove it.

---
 arch/powerpc/kvm/book3s_64_mmu.c | 3 ---
 1 file changed, 3 deletions(-)
arch/powerpc/kvm/book3s_64_mmu.c +0 -3
index 774a253..9bf7031 100644
@@ -377,15 +377,12 @@ no_seg_found:
 
 static void kvmppc_mmu_book3s_64_slbmte(struct kvm_vcpu *vcpu, u64 rs, u64 rb)
 {
-	struct kvmppc_vcpu_book3s *vcpu_book3s;
 	u64 esid, esid_1t;
 	int slb_nr;
 	struct kvmppc_slb *slbe;
 
 	dprintk("KVM MMU: slbmte(0x%llx, 0x%llx)\n", rs, rb);
 
-	vcpu_book3s = to_book3s(vcpu);
-
 	esid = GET_ESID(rb);
 	esid_1t = GET_ESID_1T(rb);
 	slb_nr = rb & 0xfff;
Signature · 1 line
2.6.2
#1 lore raw
Quoted 1 line · Geyslan G. Bem

The vcpu_book3s struct is assigned but never used. So remove it.

Just out of interest, how did you find this? Compiler warning? Static analysis? Manual inspection?

Thanks in advance!

Regards,
Daniel

Quoted 33 lines
---
 arch/powerpc/kvm/book3s_64_mmu.c | 3 ---
 1 file changed, 3 deletions(-)
arch/powerpc/kvm/book3s_64_mmu.c +0 -3
index 774a253..9bf7031 100644
@@ -377,15 +377,12 @@ no_seg_found:
 
 static void kvmppc_mmu_book3s_64_slbmte(struct kvm_vcpu *vcpu, u64 rs, u64 rb)
 {
-	struct kvmppc_vcpu_book3s *vcpu_book3s;
 	u64 esid, esid_1t;
 	int slb_nr;
 	struct kvmppc_slb *slbe;
 
 	dprintk("KVM MMU: slbmte(0x%llx, 0x%llx)\n", rs, rb);
 
-	vcpu_book3s = to_book3s(vcpu);
-
 	esid = GET_ESID(rb);
 	esid_1t = GET_ESID_1T(rb);
 	slb_nr = rb & 0xfff;
Signature · 6 lines
2.6.2

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev
#2 lore raw

2015-12-01 21:34 GMT-03:00 Daniel Axtens <[email protected]>:

Quoted 6 lines
Quoted 1 line · Geyslan G. Bem

The vcpu_book3s struct is assigned but never used. So remove it.

Just out of interest, how did you find this? Compiler warning? Static analysis? Manual inspection?

Sorry, I should have done the patch self contained. I caught it through static analysis (cppcheck).

Quoted 2 lines

Thanks in advance!

You're welcome.

Quoted 37 lines

Regards,
Daniel

Quoted 33 lines
---
 arch/powerpc/kvm/book3s_64_mmu.c | 3 ---
 1 file changed, 3 deletions(-)
arch/powerpc/kvm/book3s_64_mmu.c +0 -4
index 774a253..9bf7031 100644
@@ -377,15 +377,12 @@ no_seg_found:
 
 static void kvmppc_mmu_book3s_64_slbmte(struct kvm_vcpu *vcpu, u64 rs, u64 rb)
 {
-     struct kvmppc_vcpu_book3s *vcpu_book3s;
      u64 esid, esid_1t;
      int slb_nr;
      struct kvmppc_slb *slbe;
 
      dprintk("KVM MMU: slbmte(0x%llx, 0x%llx)\n", rs, rb);
 
-     vcpu_book3s = to_book3s(vcpu);
-
      esid = GET_ESID(rb);
      esid_1t = GET_ESID_1T(rb);
      slb_nr = rb & 0xfff;
--

2.6.2

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

Signature · 4 lines
Regards,

Geyslan G. Bem
hackingbits.com