kvm: add statics were possible, function definition in lapic.h
PATCH 1/1 kvm: add statics were possible, function definition in lapic.h
Noticed by sparse:arch/x86/kvm/vmx.c:1583:6: warning: symbol 'vmx_disable_intercept_for_msr' was not declared. Should it be static? arch/x86/kvm/x86.c:3406:5: warning: symbol 'kvm_task_switch_16' was not declared. Should it be static? arch/x86/kvm/x86.c:3429:5: warning: symbol 'kvm_task_switch_32' was not declared. Should it be static? arch/x86/kvm/mmu.c:1968:6: warning: symbol 'kvm_mmu_remove_one_alloc_mmu_page' was not declared. Should it be static? arch/x86/kvm/mmu.c:2014:6: warning: symbol 'mmu_destroy_caches' was not declared. Should it be static? arch/x86/kvm/lapic.c:862:5: warning: symbol 'kvm_lapic_get_base' was not declared. Should it be static? arch/x86/kvm/i8254.c:94:5: warning: symbol 'pit_get_gate' was not declared. Should it be static? arch/x86/kvm/i8254.c:196:5: warning: symbol '__pit_timer_fn' was not declared. Should it be static? arch/x86/kvm/i8254.c:561:6: warning: symbol '__inject_pit_timer_intr' was not declared. Should it be static?
--- arch/x86/kvm/i8254.c | 6 +++--- arch/x86/kvm/lapic.h | 1 + arch/x86/kvm/mmu.c | 4 ++-- arch/x86/kvm/vmx.c | 2 +- arch/x86/kvm/x86.c | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-)
arch/x86/kvm/i8254.c +3 -3
@@ -91,7 +91,7 @@ static void pit_set_gate(struct kvm *kvm, int channel, u32 val) c->gate = val; } -int pit_get_gate (struct kvm *kvm,int channel) +static int pit_get_gate (struct kvm *kvm,int channel) {WARN_ON (!mutex_is_locked (&kvm->arch.vpit->pit_state.lock));
@@ -193,7 +193,7 @@ static void pit_latch_status(struct kvm *kvm, int channel) } } -int __pit_timer_fn (struct kvm_kpit_state *ps) +static int __pit_timer_fn (struct kvm_kpit_state *ps) {struct kvm_vcpu *vcpu0 = ps->pit->kvm->vcpus[0 ];struct kvm_kpit_timer *pt = &ps->pit_timer;
@@ -558,7 +558,7 @@ void kvm_free_pit(struct kvm *kvm) } } -void __inject_pit_timer_intr (struct kvm *kvm) +static void __inject_pit_timer_intr (struct kvm *kvm) {mutex_lock (&kvm->lock);kvm_ioapic_set_irq (kvm->arch.vioapic,0 ,1 );
arch/x86/kvm/lapic.h +1 -0
@@ -31,6 +31,7 @@ void kvm_lapic_reset(struct kvm_vcpu *vcpu);u64 kvm_lapic_get_cr8 (struct kvm_vcpu *vcpu);void kvm_lapic_set_tpr (struct kvm_vcpu *vcpu,unsigned long cr8);void kvm_lapic_set_base (struct kvm_vcpu *vcpu,u64 value); +u64 kvm_lapic_get_base (struct kvm_vcpu *vcpu);int kvm_apic_match_physical_addr (struct kvm_lapic *apic,u16 dest);int kvm_apic_match_logical_addr (struct kvm_lapic *apic,u8 mda);
arch/x86/kvm/mmu.c +2 -2
@@ -1965,7 +1965,7 @@ void kvm_mmu_zap_all(struct kvm *kvm)kvm_flush_remote_tlbs (kvm); } -void kvm_mmu_remove_one_alloc_mmu_page (struct kvm *kvm) +static void kvm_mmu_remove_one_alloc_mmu_page (struct kvm *kvm) {struct kvm_mmu_page *page;
@@ -2011,7 +2011,7 @@ static struct shrinker mmu_shrinker = { .seeks = DEFAULT_SEEKS * 10, }; -void mmu_destroy_caches (void ) +static void mmu_destroy_caches (void ) {if (pte_chain_cache)kmem_cache_destroy (pte_chain_cache);
arch/x86/kvm/vmx.c +1 -1
@@ -1580,7 +1580,7 @@ static void allocate_vpid(struct vcpu_vmx *vmx)spin_unlock (&vmx_vpid_lock); } -void vmx_disable_intercept_for_msr (struct page *msr_bitmap,u32 msr) +static void vmx_disable_intercept_for_msr (struct page *msr_bitmap,u32 msr) {void *va;
arch/x86/kvm/x86.c +2 -2
@@ -3403,7 +3403,7 @@ static int load_state_from_tss16(struct kvm_vcpu *vcpu,return 0 ; } -int kvm_task_switch_16 (struct kvm_vcpu *vcpu,u16 tss_selector, +static int kvm_task_switch_16 (struct kvm_vcpu *vcpu,u16 tss_selector,struct desc_struct *cseg_desc,struct desc_struct *nseg_desc) {
@@ -3426,7 +3426,7 @@ out:return ret; } -int kvm_task_switch_32 (struct kvm_vcpu *vcpu,u16 tss_selector, +static int kvm_task_switch_32 (struct kvm_vcpu *vcpu,u16 tss_selector,struct desc_struct *cseg_desc,struct desc_struct *nseg_desc) {
Signature · 1 line
1.5.5.1.270.g89765
Avi Kivity
AppliedQuoted 12 lines · Harvey Harrison
Noticed by sparse:
arch/x86/kvm/vmx.c:1583:6: warning: symbol 'vmx_disable_intercept_for_msr' was not declared. Should it be static?arch/x86/kvm/x86.c:3406:5: warning: symbol 'kvm_task_switch_16' was not declared. Should it be static?arch/x86/kvm/x86.c:3429:5: warning: symbol 'kvm_task_switch_32' was not declared. Should it be static?arch/x86/kvm/mmu.c:1968:6: warning: symbol 'kvm_mmu_remove_one_alloc_mmu_page' was not declared. Should it be static?arch/x86/kvm/mmu.c:2014:6: warning: symbol 'mmu_destroy_caches' was not declared. Should it be static?arch/x86/kvm/lapic.c:862:5: warning: symbol 'kvm_lapic_get_base' was not declared. Should it be static?arch/x86/kvm/i8254.c:94:5: warning: symbol 'pit_get_gate' was not declared. Should it be static?arch/x86/kvm/i8254.c:196:5: warning: symbol '__pit_timer_fn' was not declared. Should it be static?arch/x86/kvm/i8254.c:561:6: warning: symbol '__inject_pit_timer_intr' was not declared. Should it be static?
Applied, thanks.
Signature · 1 line
error compiling committee.c: too many arguments to function