From 1bef8eb5bd1f68712980027c472371f9609987f5 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Wed, 14 Sep 2011 09:58:32 +0200 Subject: [PATCH] --- yaml --- r: 282003 b: refs/heads/master c: 3f2e5260f5a17d37be3e3c83aca2f335b9bf3893 h: refs/heads/master i: 282001: 4b0d39a40929adff7a4c9ae51e77185e3bb4c9a1 281999: ef56835383dcaeb14965d276f36a5087ff5f7184 v: v3 --- [refs] | 2 +- trunk/arch/x86/kvm/timer.c | 26 ++++---------------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/[refs] b/[refs] index 31748167ec82..0de4823ceb8d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b297e672e24687546ac74af5ae5e8c4a022b9806 +refs/heads/master: 3f2e5260f5a17d37be3e3c83aca2f335b9bf3893 diff --git a/trunk/arch/x86/kvm/timer.c b/trunk/arch/x86/kvm/timer.c index ae432ea1cd83..6b85cc647f34 100644 --- a/trunk/arch/x86/kvm/timer.c +++ b/trunk/arch/x86/kvm/timer.c @@ -18,9 +18,10 @@ #include #include "kvm_timer.h" -static int __kvm_timer_fn(struct kvm_vcpu *vcpu, struct kvm_timer *ktimer) +enum hrtimer_restart kvm_timer_fn(struct hrtimer *data) { - int restart_timer = 0; + struct kvm_timer *ktimer = container_of(data, struct kvm_timer, timer); + struct kvm_vcpu *vcpu = ktimer->vcpu; wait_queue_head_t *q = &vcpu->wq; /* @@ -40,26 +41,7 @@ static int __kvm_timer_fn(struct kvm_vcpu *vcpu, struct kvm_timer *ktimer) if (ktimer->t_ops->is_periodic(ktimer)) { hrtimer_add_expires_ns(&ktimer->timer, ktimer->period); - restart_timer = 1; - } - - return restart_timer; -} - -enum hrtimer_restart kvm_timer_fn(struct hrtimer *data) -{ - int restart_timer; - struct kvm_vcpu *vcpu; - struct kvm_timer *ktimer = container_of(data, struct kvm_timer, timer); - - vcpu = ktimer->vcpu; - if (!vcpu) - return HRTIMER_NORESTART; - - restart_timer = __kvm_timer_fn(vcpu, ktimer); - if (restart_timer) return HRTIMER_RESTART; - else + } else return HRTIMER_NORESTART; } -