Skip to contentSkip to conversation

clocksource: tcb_clksrc: Fix clock speed message

PATCH Superseded Romain Izard 1 participant 1 message Sep 5, 2017 Clocksource, clockevent drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clocksource: tcb_clksrc: Fix clock speed message

The clock speed displayed at boot in an information message was 500 kHz too high compared to its real value. As the value is not used anywhere, there is no functional impact.

Fix the rounding formula to display the correct value.

---
 drivers/clocksource/tcb_clksrc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/tcb_clksrc.c +1 -1
index 59e8aee0ec16..8fb4bea14f16 100644
@@ -383,7 +383,7 @@ static int __init tcb_clksrc_init(void)
 
 	printk(bootinfo, clksrc.name, CONFIG_ATMEL_TCB_CLKSRC_BLOCK,
 			divided_rate / 1000000,
-			((divided_rate + 500000) % 1000000) / 1000);
+			((divided_rate % 1000000) + 500) / 1000);
 
 	if (tc->tcb_config && tc->tcb_config->counter_width == 32) {
 		/* use apropriate function to read 32 bit counter */
Signature · 1 line
2.11.0