Re: [PATCH v1 1/1] sched/fair: Mark cfs_bandwidth_used() and m*_vruntime() with __maybe_unused
From: Andy Shevchenko
Date: Fri Nov 08 2024 - 04:32:13 EST
On Thu, Sep 05, 2024 at 08:12:10PM +0300, Andy Shevchenko wrote:
> When cfs_bandwidth_used() 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)
> | ^~~~~~~~~~~~
> kernel/sched/fair.c:6580:20: error: unused function 'cfs_bandwidth_used' [-Werror,-Wunused-function]
> 6580 | static inline bool cfs_bandwidth_used(void)
> | ^~~~~~~~~~~~~~~~~~
>
> Fix this by marking them with __maybe_unused (all cases for the sake of
> symmetry).
>
> See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static
> inline functions for W=1 build").
Any comments on this? Can it be eventually applied, please?
--
With Best Regards,
Andy Shevchenko