From akpm@osdl.org Mon Aug 14 22:43:29 2006 Message-Id: <200608150543.k7F5hIp9011744@shell0.pdx.osdl.net> Subject: add CONFIG_ENABLE_MUST_CHECK To: greg@kroah.com Cc: akpm@osdl.org From: akpm@osdl.org Date: Mon, 14 Aug 2006 22:43:18 -0700 From: Andrew Morton Those 1500 warnings can be a bit of a pain. Add a config option to shut them up. Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- include/linux/compiler.h | 5 +++++ lib/Kconfig.debug | 7 +++++++ 2 files changed, 12 insertions(+) --- gregkh-2.6.orig/include/linux/compiler.h +++ gregkh-2.6/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. --- gregkh-2.6.orig/lib/Kconfig.debug +++ gregkh-2.6/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"