Skip to contentSkip to conversation

clocksource: Clean up clocksource_update_freq() functions

PATCH Applied Thomas Weißschuh 2 participants 2 messages May 4 – May 6 Timekeeping, clocksource core, NTP, alarmtimer

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 clocksource: Clean up clocksource_update_freq() functions

Remove the unused functions __clocksource_update_freq_hz() and __clocksource_update_freq_khz().

Then make __clocksource_update_freq_scale() static as it is not used from external callers anymore. Also clean up the comment accordingly.

---
Changes in v2:
- Rebase on v7.1-rc1
- Pick up Ack from John
- Link to v1: https://patch.msgid.link/[email protected]

---
 include/linux/clocksource.h | 12 ------------
 kernel/time/clocksource.c   |  9 +--------
 2 files changed, 1 insertion(+), 20 deletions(-)
include/linux/clocksource.h +0 -12
index 7c38190b10bf..c61aa458d4ec 100644
@@ -236,8 +236,6 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec);
  */
 extern int
 __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq);
-extern void
-__clocksource_update_freq_scale(struct clocksource *cs, u32 scale, u32 freq);
 
 /*
  * Don't call this unless you are a default clocksource
@@ -258,16 +256,6 @@ static inline int clocksource_register_khz(struct clocksource *cs, u32 khz)
 	return __clocksource_register_scale(cs, 1000, khz);
 }
 
-static inline void __clocksource_update_freq_hz(struct clocksource *cs, u32 hz)
-{
-	__clocksource_update_freq_scale(cs, 1, hz);
-}
-
-static inline void __clocksource_update_freq_khz(struct clocksource *cs, u32 khz)
-{
-	__clocksource_update_freq_scale(cs, 1000, khz);
-}
-
 #ifdef CONFIG_ARCH_CLOCKSOURCE_INIT
 extern void clocksource_arch_init(struct clocksource *cs);
 #else
kernel/time/clocksource.c +1 -8
index baee13a1f87f..f8d15ed3ec98 100644
@@ -1222,14 +1222,8 @@ static void clocksource_enqueue(struct clocksource *cs)
  * @cs:		clocksource to be registered
  * @scale:	Scale factor multiplied against freq to get clocksource hz
  * @freq:	clocksource frequency (cycles per second) divided by scale
- *
- * This should only be called from the clocksource->enable() method.
- *
- * This *SHOULD NOT* be called directly! Please use the
- * __clocksource_update_freq_hz() or __clocksource_update_freq_khz() helper
- * functions.
  */
-void __clocksource_update_freq_scale(struct clocksource *cs, u32 scale, u32 freq)
+static void __clocksource_update_freq_scale(struct clocksource *cs, u32 scale, u32 freq)
 {
 	u64 sec;
 
@@ -1287,7 +1281,6 @@ void __clocksource_update_freq_scale(struct clocksource *cs, u32 scale, u32 freq
 	pr_info("%s: mask: 0x%llx max_cycles: 0x%llx, max_idle_ns: %lld ns\n",
 		cs->name, cs->mask, cs->max_cycles, cs->max_idle_ns);
 }
-EXPORT_SYMBOL_GPL(__clocksource_update_freq_scale);
 
 /**
  * __clocksource_register_scale - Used to install new clocksources

---
base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
change-id: 20260409-clocksource-update_freq-574ec75b9078

Best regards,

Signature · 1 line
Thomas Weißschuh <[email protected]>
#1 lore raw
The following commit has been merged into the timers/core branch of tip:

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     33d4bfc49613301c8e451a597e377aaa331944bc
Gitweb:        https://git.kernel.org/tip/33d4bfc49613301c8e451a597e377aaa331944bc
Author:        Thomas Weißschuh <[email protected]>
AuthorDate:    Mon, 04 May 2026 08:54:27 +02:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Wed, 06 May 2026 08:33:08 +02:00

clocksource: Clean up clocksource_update_freq() functions

Remove the unused functions __clocksource_update_freq_hz() and __clocksource_update_freq_khz().

Then make __clocksource_update_freq_scale() static as it is not used from external callers anymore. Also clean up the comment accordingly.

---
 include/linux/clocksource.h | 12 ------------
 kernel/time/clocksource.c   |  9 +--------
 2 files changed, 1 insertion(+), 20 deletions(-)
include/linux/clocksource.h +0 -12
index 7c38190..c61aa45 100644
@@ -236,8 +236,6 @@ clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec);
  */
 extern int
 __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq);
-extern void
-__clocksource_update_freq_scale(struct clocksource *cs, u32 scale, u32 freq);
 
 /*
  * Don't call this unless you are a default clocksource
@@ -258,16 +256,6 @@ static inline int clocksource_register_khz(struct clocksource *cs, u32 khz)
 	return __clocksource_register_scale(cs, 1000, khz);
 }
 
-static inline void __clocksource_update_freq_hz(struct clocksource *cs, u32 hz)
-{
-	__clocksource_update_freq_scale(cs, 1, hz);
-}
-
-static inline void __clocksource_update_freq_khz(struct clocksource *cs, u32 khz)
-{
-	__clocksource_update_freq_scale(cs, 1000, khz);
-}
-
 #ifdef CONFIG_ARCH_CLOCKSOURCE_INIT
 extern void clocksource_arch_init(struct clocksource *cs);
 #else
kernel/time/clocksource.c +1 -8
index baee13a..f8d15ed 100644
@@ -1222,14 +1222,8 @@ static void clocksource_enqueue(struct clocksource *cs)
  * @cs:		clocksource to be registered
  * @scale:	Scale factor multiplied against freq to get clocksource hz
  * @freq:	clocksource frequency (cycles per second) divided by scale
- *
- * This should only be called from the clocksource->enable() method.
- *
- * This *SHOULD NOT* be called directly! Please use the
- * __clocksource_update_freq_hz() or __clocksource_update_freq_khz() helper
- * functions.
  */
-void __clocksource_update_freq_scale(struct clocksource *cs, u32 scale, u32 freq)
+static void __clocksource_update_freq_scale(struct clocksource *cs, u32 scale, u32 freq)
 {
 	u64 sec;
 
@@ -1287,7 +1281,6 @@ void __clocksource_update_freq_scale(struct clocksource *cs, u32 scale, u32 freq
 	pr_info("%s: mask: 0x%llx max_cycles: 0x%llx, max_idle_ns: %lld ns\n",
 		cs->name, cs->mask, cs->max_cycles, cs->max_idle_ns);
 }
-EXPORT_SYMBOL_GPL(__clocksource_update_freq_scale);
 
 /**
  * __clocksource_register_scale - Used to install new clocksources