Commit cebc04ba9aeb3a646cc746300421fc0e5aa4f253

Authored by Andrew Morton
Committed by Greg Kroah-Hartman
1 parent 4a7fb6363f

add CONFIG_ENABLE_MUST_CHECK

Those 1500 warnings can be a bit of a pain.  Add a config option to shut them
up.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 2 changed files with 12 additions and 0 deletions Side-by-side Diff

include/linux/compiler.h
... ... @@ -99,6 +99,11 @@
99 99 #define __must_check
100 100 #endif
101 101  
  102 +#ifndef CONFIG_ENABLE_MUST_CHECK
  103 +#undef __must_check
  104 +#define __must_check
  105 +#endif
  106 +
102 107 /*
103 108 * Allow us to avoid 'defined but not used' warnings on functions and data,
104 109 * as well as force them to be emitted to the assembly file.
... ... @@ -8,6 +8,13 @@
8 8 operations. This is useful for identifying long delays
9 9 in kernel startup.
10 10  
  11 +config ENABLE_MUST_CHECK
  12 + bool "Enable __must_check logic"
  13 + default y
  14 + help
  15 + Enable the __must_check logic in the kernel build. Disable this to
  16 + suppress the "warning: ignoring return value of 'foo', declared with
  17 + attribute warn_unused_result" messages.
11 18  
12 19 config MAGIC_SYSRQ
13 20 bool "Magic SysRq key"