Commit 7d9df98b authored by Yangtao Li's avatar Yangtao Li Committed by Thomas Gleixner

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: default avatarYangtao Li <tiny.windzz@gmail.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20181104023104.2572-1-tiny.windzz@gmail.com
parent 65102238
...@@ -39,10 +39,8 @@ static u64 cev_delta2ns(unsigned long latch, struct clock_event_device *evt, ...@@ -39,10 +39,8 @@ static u64 cev_delta2ns(unsigned long latch, struct clock_event_device *evt,
u64 clc = (u64) latch << evt->shift; u64 clc = (u64) latch << evt->shift;
u64 rnd; u64 rnd;
if (unlikely(!evt->mult)) { if (WARN_ON(!evt->mult))
evt->mult = 1; evt->mult = 1;
WARN_ON(1);
}
rnd = (u64) evt->mult - 1; rnd = (u64) evt->mult - 1;
/* /*
...@@ -164,10 +162,8 @@ void clockevents_switch_state(struct clock_event_device *dev, ...@@ -164,10 +162,8 @@ void clockevents_switch_state(struct clock_event_device *dev,
* on it, so fix it up and emit a warning: * on it, so fix it up and emit a warning:
*/ */
if (clockevent_state_oneshot(dev)) { if (clockevent_state_oneshot(dev)) {
if (unlikely(!dev->mult)) { if (WARN_ON(!dev->mult))
dev->mult = 1; dev->mult = 1;
WARN_ON(1);
}
} }
} }
} }
...@@ -315,10 +311,8 @@ int clockevents_program_event(struct clock_event_device *dev, ktime_t expires, ...@@ -315,10 +311,8 @@ int clockevents_program_event(struct clock_event_device *dev, ktime_t expires,
int64_t delta; int64_t delta;
int rc; int rc;
if (unlikely(expires < 0)) { if (WARN_ON_ONCE(expires < 0))
WARN_ON_ONCE(1);
return -ETIME; return -ETIME;
}
dev->next_event = expires; dev->next_event = 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