diff mbox

[1/8] KVM: x86: return bool from kvm_apic_match*()

Message ID 1422568135-28402-2-git-send-email-rkrcmar@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Radim Krčmář Jan. 29, 2015, 9:48 p.m. UTC
And don't export the internal ones while at it.

Signed-off-by: Radim Kr?má? <rkrcmar@redhat.com>
---
 arch/x86/kvm/ioapic.h | 2 +-
 arch/x86/kvm/lapic.c  | 8 ++++----
 arch/x86/kvm/lapic.h  | 2 --
 3 files changed, 5 insertions(+), 7 deletions(-)

Comments

Joe Perches Jan. 29, 2015, 10:10 p.m. UTC | #1
On Thu, 2015-01-29 at 22:48 +0100, Radim Kr?má? wrote:
> And don't export the internal ones while at it.
[]
> -int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda)
> +static bool kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda)
>  {
>  	int result = 0;
>  	u32 logical_id;
> @@ -626,7 +626,7 @@ int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda)
>  	return result;
>  }
>  
> -int kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
> +bool kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
>  			   int short_hand, unsigned int dest, int dest_mode)
>  {
>  	int result = 0;

Perhaps these result variables should be bool.


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paolo Bonzini Jan. 30, 2015, 8:50 a.m. UTC | #2
On 29/01/2015 23:10, Joe Perches wrote:
> On Thu, 2015-01-29 at 22:48 +0100, Radim Kr?má? wrote:
>> And don't export the internal ones while at it.
> []
>> -int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda)
>> +static bool kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda)
>>  {
>>  	int result = 0;
>>  	u32 logical_id;
>> @@ -626,7 +626,7 @@ int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda)
>>  	return result;
>>  }
>>  
>> -int kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
>> +bool kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
>>  			   int short_hand, unsigned int dest, int dest_mode)
>>  {
>>  	int result = 0;
> 
> Perhaps these result variables should be bool.

See patch 2.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/x86/kvm/ioapic.h b/arch/x86/kvm/ioapic.h
index 3c9195535ffc..c2e36d934af4 100644
--- a/arch/x86/kvm/ioapic.h
+++ b/arch/x86/kvm/ioapic.h
@@ -98,7 +98,7 @@  static inline struct kvm_ioapic *ioapic_irqchip(struct kvm *kvm)
 }
 
 void kvm_rtc_eoi_tracking_restore_one(struct kvm_vcpu *vcpu);
-int kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
+bool kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
 		int short_hand, unsigned int dest, int dest_mode);
 int kvm_apic_compare_prio(struct kvm_vcpu *vcpu1, struct kvm_vcpu *vcpu2);
 void kvm_ioapic_update_eoi(struct kvm_vcpu *vcpu, int vector,
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index d1b7d42c3af0..478dd8bd653b 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -581,18 +581,18 @@  static void apic_set_tpr(struct kvm_lapic *apic, u32 tpr)
 	apic_update_ppr(apic);
 }
 
-static int kvm_apic_broadcast(struct kvm_lapic *apic, u32 dest)
+static bool kvm_apic_broadcast(struct kvm_lapic *apic, u32 dest)
 {
 	return dest == (apic_x2apic_mode(apic) ?
 			X2APIC_BROADCAST : APIC_BROADCAST);
 }
 
-int kvm_apic_match_physical_addr(struct kvm_lapic *apic, u32 dest)
+static bool kvm_apic_match_physical_addr(struct kvm_lapic *apic, u32 dest)
 {
 	return kvm_apic_id(apic) == dest || kvm_apic_broadcast(apic, dest);
 }
 
-int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda)
+static bool kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda)
 {
 	int result = 0;
 	u32 logical_id;
@@ -626,7 +626,7 @@  int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda)
 	return result;
 }
 
-int kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
+bool kvm_apic_match_dest(struct kvm_vcpu *vcpu, struct kvm_lapic *source,
 			   int short_hand, unsigned int dest, int dest_mode)
 {
 	int result = 0;
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h
index 7054437944cd..c1ef25c89508 100644
--- a/arch/x86/kvm/lapic.h
+++ b/arch/x86/kvm/lapic.h
@@ -58,8 +58,6 @@  void kvm_apic_set_version(struct kvm_vcpu *vcpu);
 
 void kvm_apic_update_tmr(struct kvm_vcpu *vcpu, u32 *tmr);
 void kvm_apic_update_irr(struct kvm_vcpu *vcpu, u32 *pir);
-int kvm_apic_match_physical_addr(struct kvm_lapic *apic, u32 dest);
-int kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda);
 int kvm_apic_set_irq(struct kvm_vcpu *vcpu, struct kvm_lapic_irq *irq,
 		unsigned long *dest_map);
 int kvm_apic_local_deliver(struct kvm_lapic *apic, int lvt_type);