Commit 61699e13 authored by Thomas Gleixner's avatar Thomas Gleixner

hrtimer: Remove hrtimer_start() return value

No user was ever interested whether the timer was active or not when
it was started. All abusers of the return value are gone, so get rid
of it.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/20150414203503.483556394@linutronix.deSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent b8a62f1f
...@@ -355,7 +355,7 @@ static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { } ...@@ -355,7 +355,7 @@ static inline void destroy_hrtimer_on_stack(struct hrtimer *timer) { }
#endif #endif
/* Basic timer operations: */ /* Basic timer operations: */
extern int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, extern void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
unsigned long range_ns, const enum hrtimer_mode mode); unsigned long range_ns, const enum hrtimer_mode mode);
/** /**
...@@ -364,21 +364,17 @@ extern int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, ...@@ -364,21 +364,17 @@ extern int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
* @tim: expiry time * @tim: expiry time
* @mode: expiry mode: absolute (HRTIMER_MODE_ABS) or * @mode: expiry mode: absolute (HRTIMER_MODE_ABS) or
* relative (HRTIMER_MODE_REL) * relative (HRTIMER_MODE_REL)
*
* Returns:
* 0 on success
* 1 when the timer was active
*/ */
static inline int hrtimer_start(struct hrtimer *timer, ktime_t tim, static inline void hrtimer_start(struct hrtimer *timer, ktime_t tim,
const enum hrtimer_mode mode) const enum hrtimer_mode mode)
{ {
return hrtimer_start_range_ns(timer, tim, 0, mode); hrtimer_start_range_ns(timer, tim, 0, mode);
} }
extern int hrtimer_cancel(struct hrtimer *timer); extern int hrtimer_cancel(struct hrtimer *timer);
extern int hrtimer_try_to_cancel(struct hrtimer *timer); extern int hrtimer_try_to_cancel(struct hrtimer *timer);
static inline int hrtimer_start_expires(struct hrtimer *timer, static inline void hrtimer_start_expires(struct hrtimer *timer,
enum hrtimer_mode mode) enum hrtimer_mode mode)
{ {
unsigned long delta; unsigned long delta;
...@@ -386,12 +382,12 @@ static inline int hrtimer_start_expires(struct hrtimer *timer, ...@@ -386,12 +382,12 @@ static inline int hrtimer_start_expires(struct hrtimer *timer,
soft = hrtimer_get_softexpires(timer); soft = hrtimer_get_softexpires(timer);
hard = hrtimer_get_expires(timer); hard = hrtimer_get_expires(timer);
delta = ktime_to_ns(ktime_sub(hard, soft)); delta = ktime_to_ns(ktime_sub(hard, soft));
return hrtimer_start_range_ns(timer, soft, delta, mode); hrtimer_start_range_ns(timer, soft, delta, mode);
} }
static inline int hrtimer_restart(struct hrtimer *timer) static inline void hrtimer_restart(struct hrtimer *timer)
{ {
return hrtimer_start_expires(timer, HRTIMER_MODE_ABS); hrtimer_start_expires(timer, HRTIMER_MODE_ABS);
} }
/* Query timers: */ /* Query timers: */
......
...@@ -593,10 +593,10 @@ tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer, ...@@ -593,10 +593,10 @@ tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
clockid_t which_clock, enum hrtimer_mode mode); clockid_t which_clock, enum hrtimer_mode mode);
static inline static inline
int tasklet_hrtimer_start(struct tasklet_hrtimer *ttimer, ktime_t time, void tasklet_hrtimer_start(struct tasklet_hrtimer *ttimer, ktime_t time,
const enum hrtimer_mode mode) const enum hrtimer_mode mode)
{ {
return hrtimer_start(&ttimer->timer, time, mode); hrtimer_start(&ttimer->timer, time, mode);
} }
static inline static inline
......
...@@ -923,22 +923,18 @@ remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base) ...@@ -923,22 +923,18 @@ remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base)
* @delta_ns: "slack" range for the timer * @delta_ns: "slack" range for the timer
* @mode: expiry mode: absolute (HRTIMER_MODE_ABS) or * @mode: expiry mode: absolute (HRTIMER_MODE_ABS) or
* relative (HRTIMER_MODE_REL) * relative (HRTIMER_MODE_REL)
*
* Returns:
* 0 on success
* 1 when the timer was active
*/ */
int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
unsigned long delta_ns, const enum hrtimer_mode mode) unsigned long delta_ns, const enum hrtimer_mode mode)
{ {
struct hrtimer_clock_base *base, *new_base; struct hrtimer_clock_base *base, *new_base;
unsigned long flags; unsigned long flags;
int ret, leftmost; int leftmost;
base = lock_hrtimer_base(timer, &flags); base = lock_hrtimer_base(timer, &flags);
/* Remove an active timer from the queue: */ /* Remove an active timer from the queue: */
ret = remove_hrtimer(timer, base); remove_hrtimer(timer, base);
if (mode & HRTIMER_MODE_REL) { if (mode & HRTIMER_MODE_REL) {
tim = ktime_add_safe(tim, base->get_time()); tim = ktime_add_safe(tim, base->get_time());
...@@ -962,11 +958,8 @@ int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, ...@@ -962,11 +958,8 @@ int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
timer_stats_hrtimer_set_start_info(timer); timer_stats_hrtimer_set_start_info(timer);
leftmost = enqueue_hrtimer(timer, new_base); leftmost = enqueue_hrtimer(timer, new_base);
if (!leftmost)
if (!leftmost) { goto unlock;
unlock_hrtimer_base(timer, &flags);
return ret;
}
if (!hrtimer_is_hres_active(timer)) { if (!hrtimer_is_hres_active(timer)) {
/* /*
...@@ -977,10 +970,8 @@ int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, ...@@ -977,10 +970,8 @@ int hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
} else { } else {
hrtimer_reprogram(timer, new_base); hrtimer_reprogram(timer, new_base);
} }
unlock:
unlock_hrtimer_base(timer, &flags); unlock_hrtimer_base(timer, &flags);
return ret;
} }
EXPORT_SYMBOL_GPL(hrtimer_start_range_ns); EXPORT_SYMBOL_GPL(hrtimer_start_range_ns);
......
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