sched: Hide unused sched_update_scaling()
authorArnd Bergmann <arnd@arndb.de>
Mon, 22 May 2023 19:50:17 +0000 (21:50 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 30 May 2023 20:46:24 +0000 (22:46 +0200)
This function is only used when CONFIG_SMP is enabled, without that there
is no caller and no prototype:

kernel/sched/fair.c:688:5: error: no previous prototype for 'sched_update_scaling' [-Werror=missing-prototypes

Hide the definition in the same #ifdef check as the declaration.

Fixes: 8a99b6833c88 ("sched: Move SCHED_DEBUG sysctl to debugfs")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20230522195021.3456768-2-arnd@kernel.org
kernel/sched/fair.c

index 48b6f0ca13acc674e7e122009482eaec14108015..2c1b345c3b8d3146b61b0a118990df1634f22922 100644 (file)
@@ -684,7 +684,7 @@ struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
 /**************************************************************
  * Scheduling class statistics methods:
  */
-
+#ifdef CONFIG_SMP
 int sched_update_scaling(void)
 {
        unsigned int factor = get_update_sysctl_factor();
@@ -702,6 +702,7 @@ int sched_update_scaling(void)
        return 0;
 }
 #endif
+#endif
 
 /*
  * delta /= w