[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190403141120.32754-13-alexandre.belloni@bootlin.com>
Date: Wed, 3 Apr 2019 16:11:20 +0200
From: Alexandre Belloni <alexandre.belloni@...tlin.com>
To: Daniel Lezcano <daniel.lezcano@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Arnd Bergmann <arnd@...db.de>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Alexander Dahl <ada@...rsis.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-pwm@...r.kernel.org,
Alexandre Belloni <alexandre.belloni@...tlin.com>
Subject: [PATCH 12/12] clocksource/drivers/timer-atmel-tcb: Use ARRAY_SIZE instead of hardcoded size
Use ARRAY_SIZE to replace the hardcoded size so we will never have a
mismatch.
Signed-off-by: Alexandre Belloni <alexandre.belloni@...tlin.com>
---
drivers/clocksource/timer-atmel-tcb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clocksource/timer-atmel-tcb.c b/drivers/clocksource/timer-atmel-tcb.c
index 10350dffd157..eab5beadf2ca 100644
--- a/drivers/clocksource/timer-atmel-tcb.c
+++ b/drivers/clocksource/timer-atmel-tcb.c
@@ -396,7 +396,7 @@ static int __init tcb_clksrc_init(struct device_node *node)
/* How fast will we be counting? Pick something over 5 MHz. */
rate = (u32) clk_get_rate(t0_clk);
- for (i = 0; i < 5; i++) {
+ for (i = 0; i < ARRAY_SIZE(atmel_tc_divisors); i++) {
unsigned divisor = atmel_tc_divisors[i];
unsigned tmp;
--
2.20.1
Powered by blists - more mailing lists