Commit 5358a963 authored by Thomas Huth's avatar Thomas Huth Committed by Alexander Graf

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: default avatarThomas Huth <thuth@redhat.com>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent 129fd423
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
/* POWER8 Micro Partition Prefetch (MPP) parameters */ /* POWER8 Micro Partition Prefetch (MPP) parameters */
/* Address mask is common for LOGMPP instruction and MPPR SPR */ /* Address mask is common for LOGMPP instruction and MPPR SPR */
#define PPC_MPPE_ADDRESS_MASK 0xffffffffc000 #define PPC_MPPE_ADDRESS_MASK 0xffffffffc000ULL
/* Bits 60 and 61 of MPP SPR should be set to one of the following */ /* Bits 60 and 61 of MPP SPR should be set to one of the following */
/* Aborting the fetch is indeed setting 00 in the table size bits */ /* Aborting the fetch is indeed setting 00 in the table size bits */
......
...@@ -240,7 +240,8 @@ void kvmppc_core_queue_inst_storage(struct kvm_vcpu *vcpu, ulong flags) ...@@ -240,7 +240,8 @@ void kvmppc_core_queue_inst_storage(struct kvm_vcpu *vcpu, ulong flags)
kvmppc_book3s_queue_irqprio(vcpu, BOOK3S_INTERRUPT_INST_STORAGE); kvmppc_book3s_queue_irqprio(vcpu, BOOK3S_INTERRUPT_INST_STORAGE);
} }
int kvmppc_book3s_irqprio_deliver(struct kvm_vcpu *vcpu, unsigned int priority) static int kvmppc_book3s_irqprio_deliver(struct kvm_vcpu *vcpu,
unsigned int priority)
{ {
int deliver = 1; int deliver = 1;
int vec = 0; int vec = 0;
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/hw_irq.h> #include <asm/hw_irq.h>
#include "book3s.h"
/* #define DEBUG_MMU */ /* #define DEBUG_MMU */
/* #define DEBUG_SR */ /* #define DEBUG_SR */
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/hw_irq.h> #include <asm/hw_irq.h>
#include "trace_pr.h" #include "trace_pr.h"
#include "book3s.h"
#define PTE_SIZE 12 #define PTE_SIZE 12
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <asm/reg.h> #include <asm/reg.h>
#include <asm/switch_to.h> #include <asm/switch_to.h>
#include <asm/time.h> #include <asm/time.h>
#include "book3s.h"
#define OP_19_XOP_RFID 18 #define OP_19_XOP_RFID 18
#define OP_19_XOP_RFI 50 #define OP_19_XOP_RFI 50
......
...@@ -214,12 +214,12 @@ static void kvmppc_set_msr_hv(struct kvm_vcpu *vcpu, u64 msr) ...@@ -214,12 +214,12 @@ static void kvmppc_set_msr_hv(struct kvm_vcpu *vcpu, u64 msr)
kvmppc_end_cede(vcpu); kvmppc_end_cede(vcpu);
} }
void kvmppc_set_pvr_hv(struct kvm_vcpu *vcpu, u32 pvr) static void kvmppc_set_pvr_hv(struct kvm_vcpu *vcpu, u32 pvr)
{ {
vcpu->arch.pvr = pvr; vcpu->arch.pvr = pvr;
} }
int kvmppc_set_arch_compat(struct kvm_vcpu *vcpu, u32 arch_compat) static int kvmppc_set_arch_compat(struct kvm_vcpu *vcpu, u32 arch_compat)
{ {
unsigned long pcr = 0; unsigned long pcr = 0;
struct kvmppc_vcore *vc = vcpu->arch.vcore; struct kvmppc_vcore *vc = vcpu->arch.vcore;
...@@ -259,7 +259,7 @@ int kvmppc_set_arch_compat(struct kvm_vcpu *vcpu, u32 arch_compat) ...@@ -259,7 +259,7 @@ int kvmppc_set_arch_compat(struct kvm_vcpu *vcpu, u32 arch_compat)
return 0; return 0;
} }
void kvmppc_dump_regs(struct kvm_vcpu *vcpu) static void kvmppc_dump_regs(struct kvm_vcpu *vcpu)
{ {
int r; int r;
...@@ -292,7 +292,7 @@ void kvmppc_dump_regs(struct kvm_vcpu *vcpu) ...@@ -292,7 +292,7 @@ void kvmppc_dump_regs(struct kvm_vcpu *vcpu)
vcpu->arch.last_inst); vcpu->arch.last_inst);
} }
struct kvm_vcpu *kvmppc_find_vcpu(struct kvm *kvm, int id) static struct kvm_vcpu *kvmppc_find_vcpu(struct kvm *kvm, int id)
{ {
int r; int r;
struct kvm_vcpu *v, *ret = NULL; struct kvm_vcpu *v, *ret = NULL;
......
...@@ -352,7 +352,7 @@ static inline u32 inst_get_field(u32 inst, int msb, int lsb) ...@@ -352,7 +352,7 @@ static inline u32 inst_get_field(u32 inst, int msb, int lsb)
return kvmppc_get_field(inst, msb + 32, lsb + 32); return kvmppc_get_field(inst, msb + 32, lsb + 32);
} }
bool kvmppc_inst_is_paired_single(struct kvm_vcpu *vcpu, u32 inst) static bool kvmppc_inst_is_paired_single(struct kvm_vcpu *vcpu, u32 inst)
{ {
if (!(vcpu->arch.hflags & BOOK3S_HFLAG_PAIRED_SINGLE)) if (!(vcpu->arch.hflags & BOOK3S_HFLAG_PAIRED_SINGLE))
return false; return false;
......
...@@ -660,7 +660,7 @@ int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu) ...@@ -660,7 +660,7 @@ int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu)
return kvmppc_core_pending_dec(vcpu); return kvmppc_core_pending_dec(vcpu);
} }
enum hrtimer_restart kvmppc_decrementer_wakeup(struct hrtimer *timer) static enum hrtimer_restart kvmppc_decrementer_wakeup(struct hrtimer *timer)
{ {
struct kvm_vcpu *vcpu; struct kvm_vcpu *vcpu;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment