aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/linux/compiler.h5
-rw-r--r--lib/Kconfig.debug7
2 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index 9b4f1109493..060b96112ec 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -99,6 +99,11 @@ extern void __chk_io_ptr(void __iomem *);
#define __must_check
#endif
+#ifndef CONFIG_ENABLE_MUST_CHECK
+#undef __must_check
+#define __must_check
+#endif
+
/*
* Allow us to avoid 'defined but not used' warnings on functions and data,
* as well as force them to be emitted to the assembly file.
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 554ee688a9f..5c114c3f03c 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -8,6 +8,13 @@ config PRINTK_TIME
operations. This is useful for identifying long delays
in kernel startup.
+config ENABLE_MUST_CHECK
+ bool "Enable __must_check logic"
+ default y
+ help
+ Enable the __must_check logic in the kernel build. Disable this to
+ suppress the "warning: ignoring return value of 'foo', declared with
+ attribute warn_unused_result" messages.
config MAGIC_SYSRQ
bool "Magic SysRq key"