diff options
| author | Frederic Weisbecker <fweisbec@gmail.com> | 2013-10-11 11:58:08 -0400 |
|---|---|---|
| committer | Frederic Weisbecker <fweisbec@gmail.com> | 2013-12-09 10:56:29 -0500 |
| commit | 531f64fd6f46a3f2a3edb1b97ecc827c775932c5 (patch) | |
| tree | ec485a59bc5cc37b195d50313d3888583345310d /kernel | |
| parent | e73d84e33f15c099ed1df60437700093cb14e46e (diff) | |
posix-timers: Convert abuses of BUG_ON to WARN_ON
The posix cpu timers code makes a heavy use of BUG_ON()
but none of these concern fatal issues that require
to stop the machine. So let's just warn the user when
some internal state slips out of our hands.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Kosaki Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/posix-cpu-timers.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c index d9dc5edc318c..3b8946416a5f 100644 --- a/kernel/posix-cpu-timers.c +++ b/kernel/posix-cpu-timers.c | |||
| @@ -395,7 +395,7 @@ static int posix_cpu_timer_del(struct k_itimer *timer) | |||
| 395 | * We raced with the reaping of the task. | 395 | * We raced with the reaping of the task. |
| 396 | * The deletion should have cleared us off the list. | 396 | * The deletion should have cleared us off the list. |
| 397 | */ | 397 | */ |
| 398 | BUG_ON(!list_empty(&timer->it.cpu.entry)); | 398 | WARN_ON_ONCE(!list_empty(&timer->it.cpu.entry)); |
| 399 | } else { | 399 | } else { |
| 400 | if (timer->it.cpu.firing) | 400 | if (timer->it.cpu.firing) |
| 401 | ret = TIMER_RETRY; | 401 | ret = TIMER_RETRY; |
| @@ -640,7 +640,7 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags, | |||
| 640 | /* | 640 | /* |
| 641 | * Disarm any old timer after extracting its expiry time. | 641 | * Disarm any old timer after extracting its expiry time. |
| 642 | */ | 642 | */ |
| 643 | BUG_ON(!irqs_disabled()); | 643 | WARN_ON_ONCE(!irqs_disabled()); |
| 644 | 644 | ||
| 645 | ret = 0; | 645 | ret = 0; |
| 646 | old_incr = timer->it.cpu.incr; | 646 | old_incr = timer->it.cpu.incr; |
| @@ -1061,7 +1061,7 @@ void posix_cpu_timer_schedule(struct k_itimer *timer) | |||
| 1061 | /* | 1061 | /* |
| 1062 | * Now re-arm for the new expiry time. | 1062 | * Now re-arm for the new expiry time. |
| 1063 | */ | 1063 | */ |
| 1064 | BUG_ON(!irqs_disabled()); | 1064 | WARN_ON_ONCE(!irqs_disabled()); |
| 1065 | arm_timer(timer); | 1065 | arm_timer(timer); |
| 1066 | unlock_task_sighand(p, &flags); | 1066 | unlock_task_sighand(p, &flags); |
| 1067 | 1067 | ||
| @@ -1150,7 +1150,7 @@ void run_posix_cpu_timers(struct task_struct *tsk) | |||
| 1150 | struct k_itimer *timer, *next; | 1150 | struct k_itimer *timer, *next; |
| 1151 | unsigned long flags; | 1151 | unsigned long flags; |
| 1152 | 1152 | ||
| 1153 | BUG_ON(!irqs_disabled()); | 1153 | WARN_ON_ONCE(!irqs_disabled()); |
| 1154 | 1154 | ||
| 1155 | /* | 1155 | /* |
| 1156 | * The fast path checks that there are no expired thread or thread | 1156 | * The fast path checks that there are no expired thread or thread |
| @@ -1217,7 +1217,7 @@ void set_process_cpu_timer(struct task_struct *tsk, unsigned int clock_idx, | |||
| 1217 | { | 1217 | { |
| 1218 | unsigned long long now; | 1218 | unsigned long long now; |
| 1219 | 1219 | ||
| 1220 | BUG_ON(clock_idx == CPUCLOCK_SCHED); | 1220 | WARN_ON_ONCE(clock_idx == CPUCLOCK_SCHED); |
| 1221 | cpu_timer_sample_group(clock_idx, tsk, &now); | 1221 | cpu_timer_sample_group(clock_idx, tsk, &now); |
| 1222 | 1222 | ||
| 1223 | if (oldval) { | 1223 | if (oldval) { |
