aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zijlstra <[email protected]>2018-08-29 11:45:21 +0200
committerIngo Molnar <[email protected]>2018-09-10 11:05:54 +0200
commit7e6f4c5d600c1c8e2a1d900e65cab319d9b6782e (patch)
tree8084ab693c21ea0752f88531d684cb3bead1d2ae
parent9c63e84db29bcf584040931ad97c2edd11e35f6c (diff)
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 <[email protected]> Tested-by: Nick Desaulniers <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r--kernel/sched/sched.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 85b3a2bf6c2b..3a4ef8f73f08 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -1401,7 +1401,7 @@ static const_debug __maybe_unused unsigned int sysctl_sched_features =
0;
#undef SCHED_FEAT
-#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 */