Skip to contentSkip to conversation

xtensa: use HZ_PER_MHZ in platform_calibrate_ccount

PATCH In review Thorsten Blum 2 participants 2 messages Sep 15, 2025 Tensilica Xtensa port (xtensa)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xtensa: use HZ_PER_MHZ in platform_calibrate_ccount

Replace the hardcoded 1000000UL with the HZ_PER_MHZ unit macro, and add a space in "10 MHz" to improve the readability of the error message.

---
 arch/xtensa/kernel/platform.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/xtensa/kernel/platform.c +3 -2
index 926b8bf0f14c..f14713060fd4 100644
@@ -14,6 +14,7 @@
 
 #include <linux/printk.h>
 #include <linux/types.h>
+#include <linux/units.h>
 #include <asm/platform.h>
 #include <asm/timex.h>
 
@@ -38,7 +39,7 @@ void __weak platform_idle(void)
 #ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
 void __weak platform_calibrate_ccount(void)
 {
-	pr_err("ERROR: Cannot calibrate cpu frequency! Assuming 10MHz.\n");
-	ccount_freq = 10 * 1000000UL;
+	pr_err("ERROR: Cannot calibrate cpu frequency! Assuming 10 MHz.\n");
+	ccount_freq = 10 * HZ_PER_MHZ;
 }
 #endif
Signature · 1 line
2.51.0
maintainer
#1 lore raw
Quoted 8 lines · Thorsten Blum

Replace the hardcoded 1000000UL with the HZ_PER_MHZ unit macro, and add a space in "10 MHz" to improve the readability of the error message.

---
 arch/xtensa/kernel/platform.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Thanks. Applied to my xtensa tree.

-- Max