summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRoberto Vargas <roberto.vargas@arm.com>2018-02-12 12:36:17 +0000
committerRoberto Vargas <roberto.vargas@arm.com>2018-02-28 17:18:21 +0000
commit9fb8af33c40f21becde99fc15db73b1f4d82059c (patch)
treec5433a1da3c86590dbe4367c66acf9b987322390 /drivers
parent322a98b6322f1b566a5c4ec65fe481dc204b3eb0 (diff)
Fix MISRA rule 8.3 in common code
Rule 8.3: All declarations of an object or function shall use the same names and type qualifiers. Change-Id: Iff384187c74a598a4e73f350a1893b60e9d16cec Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/delay_timer/delay_timer.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/delay_timer/delay_timer.c b/drivers/delay_timer/delay_timer.c
index c9f84d77..587724eb 100644
--- a/drivers/delay_timer/delay_timer.c
+++ b/drivers/delay_timer/delay_timer.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
+ * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -12,7 +12,7 @@
/***********************************************************
* The delay timer implementation
***********************************************************/
-static const timer_ops_t *ops;
+static const timer_ops_t *timer_ops;
/***********************************************************
* Delay for the given number of microseconds. The driver must
@@ -20,26 +20,27 @@ static const timer_ops_t *ops;
***********************************************************/
void udelay(uint32_t usec)
{
- assert(ops != NULL &&
- (ops->clk_mult != 0) &&
- (ops->clk_div != 0) &&
- (ops->get_timer_value != NULL));
+ assert(timer_ops != NULL &&
+ (timer_ops->clk_mult != 0) &&
+ (timer_ops->clk_div != 0) &&
+ (timer_ops->get_timer_value != NULL));
uint32_t start, delta, total_delta;
- assert(usec < UINT32_MAX / ops->clk_div);
+ assert(usec < UINT32_MAX / timer_ops->clk_div);
- start = ops->get_timer_value();
+ start = timer_ops->get_timer_value();
/* Add an extra tick to avoid delaying less than requested. */
- total_delta = div_round_up(usec * ops->clk_div, ops->clk_mult) + 1;
+ total_delta =
+ div_round_up(usec * timer_ops->clk_div, timer_ops->clk_mult) + 1;
do {
/*
* If the timer value wraps around, the subtraction will
* overflow and it will still give the correct result.
*/
- delta = start - ops->get_timer_value(); /* Decreasing counter */
+ delta = start - timer_ops->get_timer_value(); /* Decreasing counter */
} while (delta < total_delta);
}
@@ -64,5 +65,5 @@ void timer_init(const timer_ops_t *ops_ptr)
(ops_ptr->clk_div != 0) &&
(ops_ptr->get_timer_value != NULL));
- ops = ops_ptr;
+ timer_ops = ops_ptr;
}