Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hrtimer: Remove hrtimer_enqueue_reprogram()

We call hrtimer_enqueue_reprogram() only when we are in high resolution
mode now so we don't need to check that again in hrtimer_enqueue_reprogram().

Once the check is removed, hrtimer_enqueue_reprogram() turns to be an
useless wrapper over hrtimer_reprogram() and can be dropped.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1403393357-2070-6-git-send-email-fweisbec@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by

Viresh Kumar and committed by
Thomas Gleixner
9e1e01dd 49a2a075

+8 -15
+8 -15
kernel/time/hrtimer.c
··· 602 602 * timers, we have to check, whether it expires earlier than the timer for 603 603 * which the clock event device was armed. 604 604 * 605 + * Note, that in case the state has HRTIMER_STATE_CALLBACK set, no reprogramming 606 + * and no expiry check happens. The timer gets enqueued into the rbtree. The 607 + * reprogramming and expiry check is done in the hrtimer_interrupt or in the 608 + * softirq. 609 + * 605 610 * Called with interrupts disabled and base->cpu_base.lock held 606 611 */ 607 612 static int hrtimer_reprogram(struct hrtimer *timer, ··· 665 660 { 666 661 base->expires_next.tv64 = KTIME_MAX; 667 662 base->hres_active = 0; 668 - } 669 - 670 - /* 671 - * When High resolution timers are active, try to reprogram. Note, that in case 672 - * the state has HRTIMER_STATE_CALLBACK set, no reprogramming and no expiry 673 - * check happens. The timer gets enqueued into the rbtree. The reprogramming 674 - * and expiry check is done in the hrtimer_interrupt or in the softirq. 675 - */ 676 - static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer, 677 - struct hrtimer_clock_base *base) 678 - { 679 - return base->cpu_base->hres_active && hrtimer_reprogram(timer, base); 680 663 } 681 664 682 665 static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) ··· 748 755 static inline int hrtimer_switch_to_hres(void) { return 0; } 749 756 static inline void 750 757 hrtimer_force_reprogram(struct hrtimer_cpu_base *base, int skip_equal) { } 751 - static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer, 752 - struct hrtimer_clock_base *base) 758 + static inline int hrtimer_reprogram(struct hrtimer *timer, 759 + struct hrtimer_clock_base *base) 753 760 { 754 761 return 0; 755 762 } ··· 1018 1025 */ 1019 1026 wake_up_nohz_cpu(new_base->cpu_base->cpu); 1020 1027 } else if (new_base->cpu_base == &__get_cpu_var(hrtimer_bases) && 1021 - hrtimer_enqueue_reprogram(timer, new_base)) { 1028 + hrtimer_reprogram(timer, new_base)) { 1022 1029 /* 1023 1030 * Only allow reprogramming if the new base is on this CPU. 1024 1031 * (it might still be on another CPU if the timer was pending)