Commit-ID: a048466f4945ef7deea9dc03c0d637446a093345 Gitweb: http://git.kernel.org/tip/a048466f4945ef7deea9dc03c0d637446a093345 Author: Sasha Levin <levinsasha928@xxxxxxxxx> AuthorDate: Sun, 11 Dec 2011 21:50:19 +0200 Committer: Pekka Enberg <penberg@xxxxxxxxxx> CommitDate: Sun, 11 Dec 2011 22:00:47 +0200 kvm tools: Clean up LINT assignment code Just set delivery mode directly without going through ugly casting. This cleans up and simplifies the code. Signed-off-by: Sasha Levin <levinsasha928@xxxxxxxxx> Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx> --- tools/kvm/x86/kvm-cpu.c | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/kvm/x86/kvm-cpu.c b/tools/kvm/x86/kvm-cpu.c index 27b7a8f..cc1f560 100644 --- a/tools/kvm/x86/kvm-cpu.c +++ b/tools/kvm/x86/kvm-cpu.c @@ -81,18 +81,12 @@ static int kvm_cpu__set_lint(struct kvm_cpu *vcpu) { struct kvm_lapic_state klapic; struct local_apic *lapic = (void *)&klapic; - u32 lvt; if (ioctl(vcpu->vcpu_fd, KVM_GET_LAPIC, &klapic)) return -1; - lvt = *(u32 *)&lapic->lvt_lint0; - lvt = SET_APIC_DELIVERY_MODE(lvt, APIC_MODE_EXTINT); - *(u32 *)&lapic->lvt_lint0 = lvt; - - lvt = *(u32 *)&lapic->lvt_lint1; - lvt = SET_APIC_DELIVERY_MODE(lvt, APIC_MODE_NMI); - *(u32 *)&lapic->lvt_lint1 = lvt; + lapic->lvt_lint0.delivery_mode = APIC_MODE_EXTINT; + lapic->lvt_lint1.delivery_mode = APIC_MODE_NMI; return ioctl(vcpu->vcpu_fd, KVM_SET_LAPIC, &klapic); } -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html