mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Peter Zijlstra" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: "Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Nathan Chancellor <nathan@kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/core] sched: Disable -Wunused-but-set-variable
Date: Fri, 15 Oct 2021 09:45:00 -0000	[thread overview]
Message-ID: <163429110057.25758.11301671308206196345.tip-bot2@tip-bot2> (raw)
In-Reply-To: <YWWPLnaZGybHsTkv@hirez.programming.kicks-ass.net>

The following commit has been merged into the sched/core branch of tip:

Commit-ID:     37b47298ab864fb3f5488ddebfc35267ceab0553
Gitweb:        https://git.kernel.org/tip/37b47298ab864fb3f5488ddebfc35267ceab0553
Author:        Peter Zijlstra <peterz@infradead.org>
AuthorDate:    Tue, 12 Oct 2021 16:08:07 +02:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 15 Oct 2021 11:25:15 +02:00

sched: Disable -Wunused-but-set-variable

The compilers can't deal with obvious DCE vs that warning, resulting
in code like:

	if (0) {
		sched sched_statistics *stats;

		stats = __schedstats_from_se(se);

		...
	}

triggering the warning. Kill the warning to make the robots stop
reporting this.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lkml.kernel.org/r/YWWPLnaZGybHsTkv@hirez.programming.kicks-ass.net
---
 kernel/sched/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile
index 978fcfc..c7421f2 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 += $(call cc-disable-warning, 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

  parent reply	other threads:[~2021-10-15  9:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-12  3:57 [tip:sched/core 14/47] kernel/sched/fair.c:893:22: error: variable 'p' set but not used kernel test robot
2021-10-12 11:26 ` Peter Zijlstra
2021-10-12 13:35   ` Peter Zijlstra
2021-10-13  6:18     ` Yafang Shao
2021-10-14  4:23     ` Nathan Chancellor
2021-10-14 15:08       ` Peter Zijlstra
2021-10-15  9:45     ` tip-bot2 for Peter Zijlstra [this message]
2021-10-12 14:31   ` [kbuild-all] " Chen, Rong A

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=163429110057.25758.11301671308206196345.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®