summaryrefslogtreecommitdiff
path: root/kernel/time
diff options
context:
space:
mode:
authorYangtao Li <tiny.windzz@gmail.com>2018-11-04 05:31:04 +0300
committerThomas Gleixner <tglx@linutronix.de>2018-11-05 16:22:54 +0300
commit7d9df98be66fec64349f9f1c9d3e896293fe7b45 (patch)
treeb68261fdf5981e0748b5fc986c6671d8f9919376 /kernel/time
parent651022382c7f8da46cb4872a545ee1da6d097d2a (diff)
downloadlinux-7d9df98be66fec64349f9f1c9d3e896293fe7b45.tar.xz
clockevents: Remove unnecessary unlikely()
WARN_ON() and WARN_ON_ONCE() already contains an unlikely(), so it's not necessary to use unlikely. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20181104023104.2572-1-tiny.windzz@gmail.com
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/clockevents.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 8c0e4092f661..af58898d9ebf 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -39,10 +39,8 @@ static u64 cev_delta2ns(unsigned long latch, struct clock_event_device *evt,
u64 clc = (u64) latch << evt->shift;
u64 rnd;
- if (unlikely(!evt->mult)) {
+ if (WARN_ON(!evt->mult))
evt->mult = 1;
- WARN_ON(1);
- }
rnd = (u64) evt->mult - 1;
/*
@@ -164,10 +162,8 @@ void clockevents_switch_state(struct clock_event_device *dev,
* on it, so fix it up and emit a warning:
*/
if (clockevent_state_oneshot(dev)) {
- if (unlikely(!dev->mult)) {
+ if (WARN_ON(!dev->mult))
dev->mult = 1;
- WARN_ON(1);
- }
}
}
}
@@ -315,10 +311,8 @@ int clockevents_program_event(struct clock_event_device *dev, ktime_t expires,
int64_t delta;
int rc;
- if (unlikely(expires < 0)) {
- WARN_ON_ONCE(1);
+ if (WARN_ON_ONCE(expires < 0))
return -ETIME;
- }
dev->next_event = expires;