Subject: Re: linux-next: build warning after merge of the tip tree

From: Stephen Rothwell <[email-masked]>
Date: Fri, 11 Oct 2024 17:55:16 +1100

Hi all,

On Fri, 11 Oct 2024 13:55:15 +1100 Stephen Rothwell <[email-masked]> wrote:
>
> After merging the tip tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
> 
> kernel/time/clocksource.c:1258:13: warning: '__clocksource_change_rating' defined but not used [-Wunused-function]
>  1258 | static void __clocksource_change_rating(struct clocksource *cs, int rating)
>       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Introduced by commit
> 
>   5ce9bb4d5af2 ("clocksource: Remove unused clocksource_change_rating")
> 
> CONFIG_CLOCKSOURCE_WATCHDOG is not set for his build.

This became a build failure in my powerpc allyesconfig build, so I
applied the following patch.

From: Stephen Rothwell <[email-masked]>
Date: Fri, 11 Oct 2024 17:26:18 +1100
Subject: [PATCH] fix up for "clocksource: Remove unused clocksource_change_rating"

Signed-off-by: Stephen Rothwell <[email-masked]>
---
 kernel/time/clocksource.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index e041ba81c2f7..4a497cf1dff7 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -171,7 +171,6 @@ static inline void clocksource_watchdog_unlock(unsigned long *flags)
 }
 
 static int clocksource_watchdog_kthread(void *data);
-static void __clocksource_change_rating(struct clocksource *cs, int rating);
 
 static void clocksource_watchdog_work(struct work_struct *work)
 {
@@ -681,6 +680,15 @@ static void clocksource_dequeue_watchdog(struct clocksource *cs)
 	}
 }
 
+static void clocksource_enqueue(struct clocksource *cs);
+
+static void __clocksource_change_rating(struct clocksource *cs, int rating)
+{
+	list_del(&cs->list);
+	cs->rating = rating;
+	clocksource_enqueue(cs);
+}
+
 static int __clocksource_watchdog_kthread(void)
 {
 	struct clocksource *cs, *tmp;
@@ -1255,13 +1263,6 @@ int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
 }
 EXPORT_SYMBOL_GPL(__clocksource_register_scale);
 
-static void __clocksource_change_rating(struct clocksource *cs, int rating)
-{
-	list_del(&cs->list);
-	cs->rating = rating;
-	clocksource_enqueue(cs);
-}
-
 /*
  * Unbind clocksource @cs. Called with clocksource_mutex held
  */
-- 
2.45.2

-- 
Cheers,
Stephen Rothwell