Re: [PATCH] sched: Fix compile warning about variable 'uclamp_mutex'
From: Peter Zijlstra
Date: Fri Oct 25 2024 - 03:32:42 EST
On Fri, Oct 25, 2024 at 11:47:40AM +0800, Qi Xi wrote:
> When build with CONFIG_UCLAMP_TASK && !CONFIG_UCLAMP_TASK_GROUP,
> the variable 'uclamp_mutex' is defined but not used:
>
> kernel/sched/core.c:1361:21: warning: 'uclamp_mutex' defined but not used [-Wunused-variable]
> 1361 | static DEFINE_MUTEX(uclamp_mutex);
>
> Fix this by only defining the variable uclamp_mutex when the
> CONFIG_UCLAMP_TASK_GROUP is enabled.
sigh.. I hate our CONFIG space :/
Perhaps add __maybe_unused like the other variables it sits right next
to instead of adding yet more #ifdef crud?