lkml.org 
[lkml]   [2021]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [tip:sched/core 14/47] kernel/sched/fair.c:893:22: error: variable 'p' set but not used
On Tue, Oct 12, 2021 at 9:35 PM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Tue, Oct 12, 2021 at 01:26:54PM +0200, Peter Zijlstra wrote:
>
> > Again, I have absolutely no intention of fixing this. IMO this is the
> > compiler being a total pain in the arse.
> >
> > Please stop reporting this.
>
> How's this then?
>
> diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile
> index 978fcfca5871..b0d9121c5dce 100644
> --- a/kernel/sched/Makefile
> +++ b/kernel/sched/Makefile
> @@ -3,6 +3,10 @@ ifdef CONFIG_FUNCTION_TRACER
> CFLAGS_REMOVE_clock.o = $(CC_FLAGS_FTRACE)
> endif
>
> +# The compilers are complaining about unused variables inside an if(0) scope
> +# block. This is daft, shut them up.
> +ccflags-y += -Wno-unused-but-set-variable
> +
> # These files are disabled because they produce non-interesting flaky coverage
> # that is not a function of syscall inputs. E.g. involuntary context switches.
> KCOV_INSTRUMENT := n

After this diff, the warnings disappear.

Tested-by: Yafang Shao <laoar.shao@gmail.com>

--
Thanks
Yafang

\
 
 \ /
  Last update: 2021-10-13 08:19    [W:0.097 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site