Skip to contentSkip to conversation

clocksource: Remove unused clocksource_change_rating

PATCH Applied [email protected] 3 participants 5 messages Oct 9, 2024 – Oct 10, 2024 Timekeeping, clocksource core, NTP, alarmtimer

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clocksource: Remove unused clocksource_change_rating

From: "Dr. David Alan Gilbert" <[email protected]>

clocksource_change_rating() has been unused since 2017's commit 63ed4e0c67df ("Drivers: hv: vmbus: Consolidate all Hyper-V specific clocksource code")

Remove it.

---
 include/linux/clocksource.h |  1 -
 kernel/time/clocksource.c   | 21 ---------------------
 2 files changed, 22 deletions(-)
include/linux/clocksource.h +0 -1
index d35b677b08fe..ef1b16da6ad5 100644
@@ -215,7 +215,6 @@ static inline s64 clocksource_cyc2ns(u64 cycles, u32 mult, u32 shift)
 
 extern int clocksource_unregister(struct clocksource*);
 extern void clocksource_touch_watchdog(void);
-extern void clocksource_change_rating(struct clocksource *cs, int rating);
 extern void clocksource_suspend(void);
 extern void clocksource_resume(void);
 extern struct clocksource * __init clocksource_default_clock(void);
kernel/time/clocksource.c +0 -21
index 23336eecb4f4..e041ba81c2f7 100644
@@ -1262,27 +1262,6 @@ static void __clocksource_change_rating(struct clocksource *cs, int rating)
 	clocksource_enqueue(cs);
 }
 
-/**
- * clocksource_change_rating - Change the rating of a registered clocksource
- * @cs:		clocksource to be changed
- * @rating:	new rating
- */
-void clocksource_change_rating(struct clocksource *cs, int rating)
-{
-	unsigned long flags;
-
-	mutex_lock(&clocksource_mutex);
-	clocksource_watchdog_lock(&flags);
-	__clocksource_change_rating(cs, rating);
-	clocksource_watchdog_unlock(&flags);
-
-	clocksource_select();
-	clocksource_select_watchdog(false);
-	clocksource_suspend_select(false);
-	mutex_unlock(&clocksource_mutex);
-}
-EXPORT_SYMBOL(clocksource_change_rating);
-
 /*
  * Unbind clocksource @cs. Called with clocksource_mutex held
  */
Signature · 1 line
2.46.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Tue, Oct 8, 2024 at 5:30 PM <[email protected]> wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

clocksource_change_rating() has been unused since 2017's commit 63ed4e0c67df ("Drivers: hv: vmbus: Consolidate all Hyper-V specific clocksource code")

Remove it.

Thanks for submitting this cleanup!

Untested, but

thanks
-john

#4 lore raw
In reply to [email protected]
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:     5ce9bb4d5af2f5ef38f134e3cb400c873d357de7
Gitweb:        https://git.kernel.org/tip/5ce9bb4d5af2f5ef38f134e3cb400c873d357de7
Author:        Dr. David Alan Gilbert <[email protected]>
AuthorDate:    Wed, 09 Oct 2024 01:30:32 +01:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Wed, 09 Oct 2024 11:14:29 +02:00

clocksource: Remove unused clocksource_change_rating

clocksource_change_rating() has been unused since 2017's commit 63ed4e0c67df ("Drivers: hv: vmbus: Consolidate all Hyper-V specific clocksource code")

Remove it.

---
 include/linux/clocksource.h |  1 -
 kernel/time/clocksource.c   | 21 ---------------------
 2 files changed, 22 deletions(-)
include/linux/clocksource.h +0 -1
index d35b677..ef1b16d 100644
@@ -215,7 +215,6 @@ static inline s64 clocksource_cyc2ns(u64 cycles, u32 mult, u32 shift)
 
 extern int clocksource_unregister(struct clocksource*);
 extern void clocksource_touch_watchdog(void);
-extern void clocksource_change_rating(struct clocksource *cs, int rating);
 extern void clocksource_suspend(void);
 extern void clocksource_resume(void);
 extern struct clocksource * __init clocksource_default_clock(void);
kernel/time/clocksource.c +0 -21
index 23336ee..e041ba8 100644
@@ -1262,27 +1262,6 @@ static void __clocksource_change_rating(struct clocksource *cs, int rating)
 	clocksource_enqueue(cs);
 }
 
-/**
- * clocksource_change_rating - Change the rating of a registered clocksource
- * @cs:		clocksource to be changed
- * @rating:	new rating
- */
-void clocksource_change_rating(struct clocksource *cs, int rating)
-{
-	unsigned long flags;
-
-	mutex_lock(&clocksource_mutex);
-	clocksource_watchdog_lock(&flags);
-	__clocksource_change_rating(cs, rating);
-	clocksource_watchdog_unlock(&flags);
-
-	clocksource_select();
-	clocksource_select_watchdog(false);
-	clocksource_suspend_select(false);
-	mutex_unlock(&clocksource_mutex);
-}
-EXPORT_SYMBOL(clocksource_change_rating);
-
 /*
  * Unbind clocksource @cs. Called with clocksource_mutex held
  */
#2 lore raw
In reply to John Stultz
Quoted 7 lines · * John Stultz ([email protected]) wrote:
Quoted 6 lines · On Tue, Oct 8, 2024 at 5:30 PM <[email protected]> wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

clocksource_change_rating() has been unused since 2017's commit 63ed4e0c67df ("Drivers: hv: vmbus: Consolidate all Hyper-V specific clocksource code")

Quoted 8 lines
Quoted 3 lines

Remove it.

Thanks for submitting this cleanup!

Untested, but

Hmm the test robot got an unused warning on __clocksource_change_rating I think that's because it's an allnoconfig and that needs moving inside the ifdef.

I'll look at it.

Dave

Quoted 3 lines

thanks
-john

Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/
#3 lore raw
Quoted 14 lines · * Dr. David Alan Gilbert ([email protected]) wrote:
Quoted 13 lines · * John Stultz ([email protected]) wrote:
Quoted 9 lines · On Tue, Oct 8, 2024 at 5:30 PM <[email protected]> wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

clocksource_change_rating() has been unused since 2017's commit 63ed4e0c67df ("Drivers: hv: vmbus: Consolidate all Hyper-V specific clocksource code")

Remove it.

Thanks for submitting this cleanup!

Quoted 8 lines
Quoted 2 lines

Untested, but

Hmm the test robot got an unused warning on __clocksource_change_rating I think that's because it's an allnoconfig and that needs moving inside the ifdef.

I'll look at it.

v2 posted [email protected]
I shuffled the __clocksource_change_rating inside the ifdef (I guess I could have inlined it instead).

The failure the testbot found only happens on a non-x86 allnoconfig.

Dave

Quoted 11 lines

Dave

Quoted 3 lines

thanks
-john

Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/
Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/