From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754973AbbDIHKW (ORCPT ); Thu, 9 Apr 2015 03:10:22 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:36467 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932193AbbDIHKR (ORCPT ); Thu, 9 Apr 2015 03:10:17 -0400 Date: Thu, 9 Apr 2015 09:10:12 +0200 From: Ingo Molnar To: Thomas Gleixner Cc: Viresh Kumar , Ingo Molnar , Peter Zijlstra , linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, Preeti U Murthy Subject: [PATCH] hrtimers: Use consistent variable names for timerqueue_node iterations Message-ID: <20150409071012.GG14259@gmail.com> References: <20150409062841.GB14259@gmail.com> <20150409063838.GC14259@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150409063838.GC14259@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We iterate over the timerqueue_node list of base->active.next frequently, but the iterator variables are a colorful and inconsistent mix: 'next', 'next_timer' (!), 'node' and 'node_next'. For the 5 iterations we've invented 4 separate names for the same thing ... sigh. So standardize the naming to 'node_next': this both tells us that it's an rbtree node, and that it's also a next element in a list. No code changed: text data bss dec hex filename 7754 427 0 8181 1ff5 hrtimer.o.before 7754 427 0 8181 1ff5 hrtimer.o.after md5: de9af3b01d50c72af2d8b026ed22704a hrtimer.o.before.asm de9af3b01d50c72af2d8b026ed22704a hrtimer.o.after.asm Signed-off-by: Ingo Molnar --- kernel/time/hrtimer.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) Index: tip/kernel/time/hrtimer.c =================================================================== --- tip.orig/kernel/time/hrtimer.c +++ tip/kernel/time/hrtimer.c @@ -448,14 +448,14 @@ static ktime_t __hrtimer_get_next_event( int i; for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++, base++) { - struct timerqueue_node *next; + struct timerqueue_node *node_next; struct hrtimer *timer; - next = base->active.next; - if (!next) + node_next = base->active.next; + if (!node_next) continue; - timer = container_of(next, struct hrtimer, node); + timer = container_of(node_next, struct hrtimer, node); expires = ktime_sub(hrtimer_get_expires(timer), base->offset); if (expires.tv64 < expires_next.tv64) expires_next = expires; @@ -872,13 +872,13 @@ static void __remove_hrtimer(struct hrti struct hrtimer_clock_base *base, unsigned long newstate, int reprogram) { - struct timerqueue_node *next_timer; + struct timerqueue_node *node_next; if (!(timer->state & HRTIMER_STATE_ENQUEUED)) goto out; - next_timer = base->active.next; + node_next = base->active.next; timerqueue_del(&base->active, &timer->node); - if (&timer->node == next_timer) { + if (&timer->node == node_next) { #ifdef CONFIG_HIGH_RES_TIMERS /* Reprogram the clock event device. if enabled */ if (reprogram && hrtimer_hres_active()) { @@ -1262,7 +1262,7 @@ retry: for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) { struct hrtimer_clock_base *base; - struct timerqueue_node *node; + struct timerqueue_node *node_next; ktime_t basenow; base = cpu_base->clock_base + i; @@ -1271,10 +1271,10 @@ retry: basenow = ktime_add(now, base->offset); - while ((node = base->active.next)) { + while ((node_next = base->active.next)) { struct hrtimer *timer; - timer = container_of(node, struct hrtimer, node); + timer = container_of(node_next, struct hrtimer, node); /* * The immediate goal for using the softexpires is @@ -1428,7 +1428,7 @@ void hrtimer_run_pending(void) */ void hrtimer_run_queues(void) { - struct timerqueue_node *node; + struct timerqueue_node *node_next; struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases); struct hrtimer_clock_base *base; int index, gettime = 1; @@ -1448,10 +1448,10 @@ void hrtimer_run_queues(void) raw_spin_lock(&cpu_base->lock); - while ((node = base->active.next)) { + while ((node_next = base->active.next)) { struct hrtimer *timer; - timer = container_of(node, struct hrtimer, node); + timer = container_of(node_next, struct hrtimer, node); if (base->softirq_time.tv64 <= hrtimer_get_expires_tv64(timer)) break; @@ -1629,10 +1629,10 @@ static void migrate_hrtimer_list(struct struct hrtimer_clock_base *new_base) { struct hrtimer *timer; - struct timerqueue_node *node; + struct timerqueue_node *node_next; - while ((node = old_base->active.next)) { - timer = container_of(node, struct hrtimer, node); + while ((node_next = old_base->active.next)) { + timer = container_of(node_next, struct hrtimer, node); BUG_ON(hrtimer_callback_running(timer)); debug_deactivate(timer);