From 751022e43b304dff65e327b9dae84284b2a0f313 Mon Sep 17 00:00:00 2001 From: Yonattan Louise Date: Fri, 8 May 2015 17:12:59 -0500 Subject: [PATCH] Rename oldCount to old_count Updating local variable's name to follow a consistent naming convention. Change accomplished with the following script: #!/bin/bash echo "Searching for ${1} to replace with ${2}" find ./ \( -name "*.[chs]" -o -name "sysgen.py" -o -name "*.kconf" -o -name "*.arch" \) \ ! -path "./host/src/genIdt/*" \ ! -path "*/outdir/*" | xargs sed -i 's/\b'${1}'\b/'${2}'/g'; Change-Id: I6098649b507dae09d4d0f19e712bc0fe3686dfc0 Signed-off-by: Yonattan Louise --- drivers/timer/i8253.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/timer/i8253.c b/drivers/timer/i8253.c index 29cc3fda576..77fa825e951 100644 --- a/drivers/timer/i8253.c +++ b/drivers/timer/i8253.c @@ -148,7 +148,7 @@ static uint16_t __noinit timer_idle_skew; static unsigned char timer_mode = TIMER_MODE_PERIODIC; #endif /* TIMER_SUPPORTS_TICKLESS */ -static uint32_t oldCount = 0; /* previous system clock value */ +static uint32_t old_count = 0; /* previous system clock value */ static uint32_t oldAcc = 0; /* previous accumulated value value */ /* externs */ @@ -304,12 +304,12 @@ void _timer_int_handler(void *unusedArg /* not used */ /* * Algorithm tries to compensate lost interrupts if any happened and * prevent the timer from counting backwards - * ULONG_MAX / 2 is the maximal value that oldCount can be more than + * ULONG_MAX / 2 is the maximal value that old_count can be more than * clock_accumulated_count. If it is more -- consider it as an clock_accumulated_count * wrap and do not try to compensate. */ - if (clock_accumulated_count < oldCount) { - uint32_t tmp = oldCount - clock_accumulated_count; + if (clock_accumulated_count < old_count) { + uint32_t tmp = old_count - clock_accumulated_count; if ((tmp >= counterLoadVal) && (tmp < (ULONG_MAX / 2))) { clock_accumulated_count += tmp - tmp % counterLoadVal; } @@ -576,12 +576,12 @@ uint32_t timer_read(void) * happened before the timer interrupt (due to possible interrupt * disable) */ - if ((newCount < oldCount) && (clock_accumulated_count == oldAcc)) { - uint32_t tmp = oldCount - newCount; + if ((newCount < old_count) && (clock_accumulated_count == oldAcc)) { + uint32_t tmp = old_count - newCount; newCount += tmp - tmp % _currentLoadVal + _currentLoadVal; } - oldCount = newCount; + old_count = newCount; oldAcc = clock_accumulated_count; #ifdef CONFIG_INT_LATENCY_BENCHMARK