Files
linux/kernel
Peter Zijlstra 18bae38a20 UPSTREAM: sched: Fix DEBUG && !SCHEDSTATS warn
commit 769fdf83df upstream.

When !SCHEDSTATS schedstat_enabled() is an unconditional 0 and the
whole block doesn't exist, however GCC figures the scoped variable
'stats' is unused and complains about it.

Upgrade the warning from -Wunused-variable to -Wunused-but-set-variable
by writing it in two statements. This fixes the build because the new
warning is in W=1.

Given that whole if(0) {} thing, I don't feel motivated to change
things overly much and quite strongly feel this is the compiler being
daft.

Fixes: cb3e971c435d ("sched: Make struct sched_statistics independent of fair sched class")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Change-Id: I3b1f6cc605ae53a43f4a75a8d1a6cf2a947998ea
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 0a008c5098)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-06-14 12:35:34 +00:00
..
2023-04-26 13:37:41 +00:00
2023-04-17 11:31:12 +00:00
2022-12-31 13:14:47 +01:00
2023-03-23 12:10:59 +00:00
2023-06-09 08:39:36 +00:00
2023-03-21 10:16:45 +00:00
2023-03-17 13:35:31 +00:00
2023-04-25 16:02:54 +00:00
2023-01-18 12:52:16 +00:00
2022-02-23 12:30:26 +01:00
2023-02-01 09:38:19 +00:00
2023-03-23 12:10:59 +00:00
2021-05-07 00:26:33 -07:00
2023-02-01 09:38:19 +00:00
2021-09-28 08:49:54 -07:00
2020-07-27 14:31:12 -04:00
2022-04-24 16:57:32 +02:00
2023-04-26 13:37:41 +00:00
2023-02-01 09:38:19 +00:00
2020-08-19 14:13:20 +02:00
2022-09-24 10:01:09 +02:00