Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: PPC: Fix warnings from sparse

When compiling the KVM code for POWER with "make C=1", sparse
complains about functions missing proper prototypes and a 64-bit
constant missing the ULL prefix. Let's fix this by making the
functions static or by including the proper header with the
prototypes, and by appending a ULL prefix to the constant
PPC_MPPE_ADDRESS_MASK.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

authored by

Thomas Huth and committed by
Alexander Graf
5358a963 129fd423

+12 -8
+1 -1
arch/powerpc/include/asm/ppc-opcode.h
··· 287 287 288 288 /* POWER8 Micro Partition Prefetch (MPP) parameters */ 289 289 /* Address mask is common for LOGMPP instruction and MPPR SPR */ 290 - #define PPC_MPPE_ADDRESS_MASK 0xffffffffc000 290 + #define PPC_MPPE_ADDRESS_MASK 0xffffffffc000ULL 291 291 292 292 /* Bits 60 and 61 of MPP SPR should be set to one of the following */ 293 293 /* Aborting the fetch is indeed setting 00 in the table size bits */
+2 -1
arch/powerpc/kvm/book3s.c
··· 240 240 kvmppc_book3s_queue_irqprio(vcpu, BOOK3S_INTERRUPT_INST_STORAGE); 241 241 } 242 242 243 - int kvmppc_book3s_irqprio_deliver(struct kvm_vcpu *vcpu, unsigned int priority) 243 + static int kvmppc_book3s_irqprio_deliver(struct kvm_vcpu *vcpu, 244 + unsigned int priority) 244 245 { 245 246 int deliver = 1; 246 247 int vec = 0;
+1
arch/powerpc/kvm/book3s_32_mmu_host.c
··· 26 26 #include <asm/machdep.h> 27 27 #include <asm/mmu_context.h> 28 28 #include <asm/hw_irq.h> 29 + #include "book3s.h" 29 30 30 31 /* #define DEBUG_MMU */ 31 32 /* #define DEBUG_SR */
+1
arch/powerpc/kvm/book3s_64_mmu_host.c
··· 28 28 #include <asm/mmu_context.h> 29 29 #include <asm/hw_irq.h> 30 30 #include "trace_pr.h" 31 + #include "book3s.h" 31 32 32 33 #define PTE_SIZE 12 33 34
+1
arch/powerpc/kvm/book3s_emulate.c
··· 23 23 #include <asm/reg.h> 24 24 #include <asm/switch_to.h> 25 25 #include <asm/time.h> 26 + #include "book3s.h" 26 27 27 28 #define OP_19_XOP_RFID 18 28 29 #define OP_19_XOP_RFI 50
+4 -4
arch/powerpc/kvm/book3s_hv.c
··· 214 214 kvmppc_end_cede(vcpu); 215 215 } 216 216 217 - void kvmppc_set_pvr_hv(struct kvm_vcpu *vcpu, u32 pvr) 217 + static void kvmppc_set_pvr_hv(struct kvm_vcpu *vcpu, u32 pvr) 218 218 { 219 219 vcpu->arch.pvr = pvr; 220 220 } 221 221 222 - int kvmppc_set_arch_compat(struct kvm_vcpu *vcpu, u32 arch_compat) 222 + static int kvmppc_set_arch_compat(struct kvm_vcpu *vcpu, u32 arch_compat) 223 223 { 224 224 unsigned long pcr = 0; 225 225 struct kvmppc_vcore *vc = vcpu->arch.vcore; ··· 259 259 return 0; 260 260 } 261 261 262 - void kvmppc_dump_regs(struct kvm_vcpu *vcpu) 262 + static void kvmppc_dump_regs(struct kvm_vcpu *vcpu) 263 263 { 264 264 int r; 265 265 ··· 292 292 vcpu->arch.last_inst); 293 293 } 294 294 295 - struct kvm_vcpu *kvmppc_find_vcpu(struct kvm *kvm, int id) 295 + static struct kvm_vcpu *kvmppc_find_vcpu(struct kvm *kvm, int id) 296 296 { 297 297 int r; 298 298 struct kvm_vcpu *v, *ret = NULL;
+1 -1
arch/powerpc/kvm/book3s_paired_singles.c
··· 352 352 return kvmppc_get_field(inst, msb + 32, lsb + 32); 353 353 } 354 354 355 - bool kvmppc_inst_is_paired_single(struct kvm_vcpu *vcpu, u32 inst) 355 + static bool kvmppc_inst_is_paired_single(struct kvm_vcpu *vcpu, u32 inst) 356 356 { 357 357 if (!(vcpu->arch.hflags & BOOK3S_HFLAG_PAIRED_SINGLE)) 358 358 return false;
+1 -1
arch/powerpc/kvm/powerpc.c
··· 660 660 return kvmppc_core_pending_dec(vcpu); 661 661 } 662 662 663 - enum hrtimer_restart kvmppc_decrementer_wakeup(struct hrtimer *timer) 663 + static enum hrtimer_restart kvmppc_decrementer_wakeup(struct hrtimer *timer) 664 664 { 665 665 struct kvm_vcpu *vcpu; 666 666