/* Returns 0 when the timer has expired otherwise -EINTR  */
int __sched schedule_hrtimeout_range(ktime_t *expires, unsigned long delta, const enum hrtimer_mode mode)
/* Returns 0 when the timer has expired otherwise -EINTR  */
int __sched schedule_hrtimeout_range(ktime_t *expires, unsigned long delta, const enum hrtimer_mode mode)
{
	struct hrtimer_sleeper t;
	if (expires && !expires->tv64) {
		__set_current_state(TASK_RUNNING);
		return 0;
	}
	if (!expires) {
		schedule();
		__set_current_state(TASK_RUNNING);
		return -EINTR;
	}
	hrtimer_init_on_stack(&t.timer, CLOCK_MONOTONIC, mode);
	hrtimer_set_expires_range_ns(&t.timer, *expires, delta);
	hrtimer_init_sleeper(&t, current);
	hrtimer_start_expires(&t.timer, mode);
	if (!hrtimer_active(&t.timer))
		t.task = NULL;
	if (likely(t.task))
		schedule();
	hrtimer_cancel(&t.timer);
	destroy_hrtimer_on_stack(&t.timer);
	__set_current_state(TASK_RUNNING);
	return !t.task ? 0 : -EINTR;
}