lkml.org 
[lkml]   [2019]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 12/12] clocksource/drivers/timer-atmel-tcb: Use ARRAY_SIZE instead of hardcoded size
Date
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(-)

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
\
 
 \ /
  Last update: 2019-04-03 16:12    [W:0.153 / U:0.992 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site