diff options
author | Peter Zijlstra <peterz@infradead.org> | 2018-08-29 11:45:21 +0200 |
---|---|---|
committer | Michael Bestas <mkbestas@lineageos.org> | 2020-02-02 01:40:03 +0200 |
commit | 934bf1429fe4744fa468b79c88d5bb56f5b8c4d3 (patch) | |
tree | 157c9a93d5d4938a08eeb11fce6209d8492b6c22 /kernel/sched | |
parent | 422f6e6549b3bc5c2ca9b1e4a8fb0d2fa7f56578 (diff) |
BACKPORT: sched/debug: Explicitly cast sched_feat() to bool
LLVM has a warning that tags expressions like:
if (foo && non-bool-const)
This pattern triggers for CONFIG_SCHED_DEBUG=n where sched_feat() ends
up being whatever bit we select. Avoid the warning with an explicit
cast to bool.
Reported-by: Philipp Klocke <philipp97kl@gmail.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://git.kernel.org/linus/7e6f4c5d600c1c8e2a1d900e65cab319d9b6782e
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/sched.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 2315fbfcd64d..38c8539edb17 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1855,7 +1855,7 @@ static __always_inline bool static_branch_##name(struct static_key *key) \ extern struct static_key sched_feat_keys[__SCHED_FEAT_NR]; #define sched_feat(x) (static_branch_##x(&sched_feat_keys[__SCHED_FEAT_##x])) #else /* !(SCHED_DEBUG && HAVE_JUMP_LABEL) */ -#define sched_feat(x) (sysctl_sched_features & (1UL << __SCHED_FEAT_##x)) +#define sched_feat(x) !!(sysctl_sched_features & (1UL << __SCHED_FEAT_##x)) #endif /* SCHED_DEBUG && HAVE_JUMP_LABEL */ extern struct static_key_false sched_numa_balancing; |