Skip to content

Commit 95d9fed

Browse files
andy-shevPeter Zijlstra
authored andcommitted
sched/fair: Mark m*_vruntime() with __maybe_unused
When max_vruntime() is unused, it prevents kernel builds with clang, `make W=1` and CONFIG_WERROR=y: kernel/sched/fair.c:526:19: error: unused function 'max_vruntime' [-Werror,-Wunused-function] 526 | static inline u64 max_vruntime(u64 max_vruntime, u64 vruntime) | ^~~~~~~~~~~~ Fix this by marking them with __maybe_unused (all cases for the sake of symmetry). See also commit 6863f56 ("kbuild: allow Clang to find unused static inline functions for W=1 build"). Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 0429489 commit 95d9fed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/sched/fair.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ void account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec);
523523
* Scheduling class tree data structure manipulation methods:
524524
*/
525525

526-
static inline u64 max_vruntime(u64 max_vruntime, u64 vruntime)
526+
static inline __maybe_unused u64 max_vruntime(u64 max_vruntime, u64 vruntime)
527527
{
528528
s64 delta = (s64)(vruntime - max_vruntime);
529529
if (delta > 0)
@@ -532,7 +532,7 @@ static inline u64 max_vruntime(u64 max_vruntime, u64 vruntime)
532532
return max_vruntime;
533533
}
534534

535-
static inline u64 min_vruntime(u64 min_vruntime, u64 vruntime)
535+
static inline __maybe_unused u64 min_vruntime(u64 min_vruntime, u64 vruntime)
536536
{
537537
s64 delta = (s64)(vruntime - min_vruntime);
538538
if (delta < 0)

0 commit comments

Comments
 (0)