Skip to content

Commit bafffd5

Browse files
Dr. David Alan GilbertKAGA-KOKO
Dr. David Alan Gilbert
authored andcommitted
clocksource: Remove unused clocksource_change_rating
clocksource_change_rating() has been unused since 2017's commit 63ed4e0 ("Drivers: hv: vmbus: Consolidate all Hyper-V specific clocksource code") Remove it. __clocksource_change_rating now only has one use which is ifdef'd. Move it into the ifdef'd section. Signed-off-by: Dr. David Alan Gilbert <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent b7f6d3a commit bafffd5

File tree

2 files changed

+10
-31
lines changed

2 files changed

+10
-31
lines changed

include/linux/clocksource.h

-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ static inline s64 clocksource_cyc2ns(u64 cycles, u32 mult, u32 shift)
215215

216216
extern int clocksource_unregister(struct clocksource*);
217217
extern void clocksource_touch_watchdog(void);
218-
extern void clocksource_change_rating(struct clocksource *cs, int rating);
219218
extern void clocksource_suspend(void);
220219
extern void clocksource_resume(void);
221220
extern struct clocksource * __init clocksource_default_clock(void);

kernel/time/clocksource.c

+10-30
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "tick-internal.h"
2121
#include "timekeeping_internal.h"
2222

23+
static void clocksource_enqueue(struct clocksource *cs);
24+
2325
static noinline u64 cycles_to_nsec_safe(struct clocksource *cs, u64 start, u64 end)
2426
{
2527
u64 delta = clocksource_delta(end, start, cs->mask);
@@ -171,7 +173,6 @@ static inline void clocksource_watchdog_unlock(unsigned long *flags)
171173
}
172174

173175
static int clocksource_watchdog_kthread(void *data);
174-
static void __clocksource_change_rating(struct clocksource *cs, int rating);
175176

176177
static void clocksource_watchdog_work(struct work_struct *work)
177178
{
@@ -191,6 +192,13 @@ static void clocksource_watchdog_work(struct work_struct *work)
191192
kthread_run(clocksource_watchdog_kthread, NULL, "kwatchdog");
192193
}
193194

195+
static void clocksource_change_rating(struct clocksource *cs, int rating)
196+
{
197+
list_del(&cs->list);
198+
cs->rating = rating;
199+
clocksource_enqueue(cs);
200+
}
201+
194202
static void __clocksource_unstable(struct clocksource *cs)
195203
{
196204
cs->flags &= ~(CLOCK_SOURCE_VALID_FOR_HRES | CLOCK_SOURCE_WATCHDOG);
@@ -697,7 +705,7 @@ static int __clocksource_watchdog_kthread(void)
697705
list_for_each_entry_safe(cs, tmp, &watchdog_list, wd_list) {
698706
if (cs->flags & CLOCK_SOURCE_UNSTABLE) {
699707
list_del_init(&cs->wd_list);
700-
__clocksource_change_rating(cs, 0);
708+
clocksource_change_rating(cs, 0);
701709
select = 1;
702710
}
703711
if (cs->flags & CLOCK_SOURCE_RESELECT) {
@@ -1255,34 +1263,6 @@ int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
12551263
}
12561264
EXPORT_SYMBOL_GPL(__clocksource_register_scale);
12571265

1258-
static void __clocksource_change_rating(struct clocksource *cs, int rating)
1259-
{
1260-
list_del(&cs->list);
1261-
cs->rating = rating;
1262-
clocksource_enqueue(cs);
1263-
}
1264-
1265-
/**
1266-
* clocksource_change_rating - Change the rating of a registered clocksource
1267-
* @cs: clocksource to be changed
1268-
* @rating: new rating
1269-
*/
1270-
void clocksource_change_rating(struct clocksource *cs, int rating)
1271-
{
1272-
unsigned long flags;
1273-
1274-
mutex_lock(&clocksource_mutex);
1275-
clocksource_watchdog_lock(&flags);
1276-
__clocksource_change_rating(cs, rating);
1277-
clocksource_watchdog_unlock(&flags);
1278-
1279-
clocksource_select();
1280-
clocksource_select_watchdog(false);
1281-
clocksource_suspend_select(false);
1282-
mutex_unlock(&clocksource_mutex);
1283-
}
1284-
EXPORT_SYMBOL(clocksource_change_rating);
1285-
12861266
/*
12871267
* Unbind clocksource @cs. Called with clocksource_mutex held
12881268
*/

0 commit comments

Comments
 (0)