Commit ca366a32 authored by Martin Schwidefsky's avatar Martin Schwidefsky Committed by Heiko Carstens

[S390] Cleanup vtime printk messages.

Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
parent c78aa6cb
...@@ -318,8 +318,7 @@ static void internal_add_vtimer(struct vtimer_list *timer) ...@@ -318,8 +318,7 @@ static void internal_add_vtimer(struct vtimer_list *timer)
vt_list = &per_cpu(virt_cpu_timer, timer->cpu); vt_list = &per_cpu(virt_cpu_timer, timer->cpu);
spin_lock_irqsave(&vt_list->lock, flags); spin_lock_irqsave(&vt_list->lock, flags);
if (timer->cpu != smp_processor_id()) BUG_ON(timer->cpu != smp_processor_id());
printk("internal_add_vtimer: BUG, running on wrong CPU");
/* if list is empty we only have to set the timer */ /* if list is empty we only have to set the timer */
if (list_empty(&vt_list->list)) { if (list_empty(&vt_list->list)) {
...@@ -353,25 +352,12 @@ static void internal_add_vtimer(struct vtimer_list *timer) ...@@ -353,25 +352,12 @@ static void internal_add_vtimer(struct vtimer_list *timer)
put_cpu(); put_cpu();
} }
static inline int prepare_vtimer(struct vtimer_list *timer) static inline void prepare_vtimer(struct vtimer_list *timer)
{ {
if (!timer->function) { BUG_ON(!timer->function);
printk("add_virt_timer: uninitialized timer\n"); BUG_ON(!timer->expires || timer->expires > VTIMER_MAX_SLICE);
return -EINVAL; BUG_ON(vtimer_pending(timer));
}
if (!timer->expires || timer->expires > VTIMER_MAX_SLICE) {
printk("add_virt_timer: invalid timer expire value!\n");
return -EINVAL;
}
if (vtimer_pending(timer)) {
printk("add_virt_timer: timer pending\n");
return -EBUSY;
}
timer->cpu = get_cpu(); timer->cpu = get_cpu();
return 0;
} }
/* /*
...@@ -382,10 +368,7 @@ void add_virt_timer(void *new) ...@@ -382,10 +368,7 @@ void add_virt_timer(void *new)
struct vtimer_list *timer; struct vtimer_list *timer;
timer = (struct vtimer_list *)new; timer = (struct vtimer_list *)new;
prepare_vtimer(timer);
if (prepare_vtimer(timer) < 0)
return;
timer->interval = 0; timer->interval = 0;
internal_add_vtimer(timer); internal_add_vtimer(timer);
} }
...@@ -399,10 +382,7 @@ void add_virt_timer_periodic(void *new) ...@@ -399,10 +382,7 @@ void add_virt_timer_periodic(void *new)
struct vtimer_list *timer; struct vtimer_list *timer;
timer = (struct vtimer_list *)new; timer = (struct vtimer_list *)new;
prepare_vtimer(timer);
if (prepare_vtimer(timer) < 0)
return;
timer->interval = timer->expires; timer->interval = timer->expires;
internal_add_vtimer(timer); internal_add_vtimer(timer);
} }
...@@ -423,15 +403,8 @@ int mod_virt_timer(struct vtimer_list *timer, __u64 expires) ...@@ -423,15 +403,8 @@ int mod_virt_timer(struct vtimer_list *timer, __u64 expires)
unsigned long flags; unsigned long flags;
int cpu; int cpu;
if (!timer->function) { BUG_ON(!timer->function);
printk("mod_virt_timer: uninitialized timer\n"); BUG_ON(!expires || expires > VTIMER_MAX_SLICE);
return -EINVAL;
}
if (!expires || expires > VTIMER_MAX_SLICE) {
printk("mod_virt_timer: invalid expire range\n");
return -EINVAL;
}
/* /*
* This is a common optimization triggered by the * This is a common optimization triggered by the
...@@ -444,6 +417,9 @@ int mod_virt_timer(struct vtimer_list *timer, __u64 expires) ...@@ -444,6 +417,9 @@ int mod_virt_timer(struct vtimer_list *timer, __u64 expires)
cpu = get_cpu(); cpu = get_cpu();
vt_list = &per_cpu(virt_cpu_timer, cpu); vt_list = &per_cpu(virt_cpu_timer, cpu);
/* check if we run on the right CPU */
BUG_ON(timer->cpu != cpu);
/* disable interrupts before test if timer is pending */ /* disable interrupts before test if timer is pending */
spin_lock_irqsave(&vt_list->lock, flags); spin_lock_irqsave(&vt_list->lock, flags);
...@@ -458,14 +434,6 @@ int mod_virt_timer(struct vtimer_list *timer, __u64 expires) ...@@ -458,14 +434,6 @@ int mod_virt_timer(struct vtimer_list *timer, __u64 expires)
return 0; return 0;
} }
/* check if we run on the right CPU */
if (timer->cpu != cpu) {
printk("mod_virt_timer: running on wrong CPU, check your code\n");
spin_unlock_irqrestore(&vt_list->lock, flags);
put_cpu();
return -EINVAL;
}
list_del_init(&timer->entry); list_del_init(&timer->entry);
timer->expires = expires; timer->expires = expires;
......
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