[12/12] clocksource/drivers/timer-atmel-tcb: Use ARRAY_SIZE instead of hardcoded size
diff mbox series

Message ID 20190403141120.32754-13-alexandre.belloni@bootlin.com
State New
Headers show
Series
  • clocksource: improve Atmel TCB timer driver
Related show

Commit Message

Alexandre Belloni April 3, 2019, 2:11 p.m. UTC
Use ARRAY_SIZE to replace the hardcoded size so we will never have a
mismatch.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
---
 drivers/clocksource/timer-atmel-tcb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

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;