Skip to content

Commit f4f6a2e

Browse files
committed
Merge tag 'compiler-attributes-for-linus-v5.11' of git://github.com/ojeda/linux
Pull ENABLE_MUST_CHECK removal from Miguel Ojeda: "Remove CONFIG_ENABLE_MUST_CHECK (Masahiro Yamada)" Note that this removes the config option by making the must-check unconditional, not by removing must check itself. * tag 'compiler-attributes-for-linus-v5.11' of git://github.com/ojeda/linux: Compiler Attributes: remove CONFIG_ENABLE_MUST_CHECK
2 parents e71ba94 + 1967939 commit f4f6a2e

4 files changed

Lines changed: 6 additions & 15 deletions

File tree

include/linux/compiler_attributes.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,12 @@
272272
*/
273273
#define __used __attribute__((__used__))
274274

275+
/*
276+
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-warn_005funused_005fresult-function-attribute
277+
* clang: https://clang.llvm.org/docs/AttributeReference.html#nodiscard-warn-unused-result
278+
*/
279+
#define __must_check __attribute__((__warn_unused_result__))
280+
275281
/*
276282
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-weak-function-attribute
277283
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-weak-variable-attribute

include/linux/compiler_types.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@ struct ftrace_likely_data {
121121
unsigned long constant;
122122
};
123123

124-
#ifdef CONFIG_ENABLE_MUST_CHECK
125-
#define __must_check __attribute__((__warn_unused_result__))
126-
#else
127-
#define __must_check
128-
#endif
129-
130124
#if defined(CC_USING_HOTPATCH)
131125
#define notrace __attribute__((hotpatch(0, 0)))
132126
#elif defined(CC_USING_PATCHABLE_FUNCTION_ENTRY)

lib/Kconfig.debug

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,14 +295,6 @@ config GDB_SCRIPTS
295295

296296
endif # DEBUG_INFO
297297

298-
config ENABLE_MUST_CHECK
299-
bool "Enable __must_check logic"
300-
default y
301-
help
302-
Enable the __must_check logic in the kernel build. Disable this to
303-
suppress the "warning: ignoring return value of 'foo', declared with
304-
attribute warn_unused_result" messages.
305-
306298
config FRAME_WARN
307299
int "Warn for stack frames larger than"
308300
range 0 8192

tools/testing/selftests/wireguard/qemu/debug.config

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CONFIG_LOCALVERSION="-debug"
2-
CONFIG_ENABLE_MUST_CHECK=y
32
CONFIG_FRAME_POINTER=y
43
CONFIG_STACK_VALIDATION=y
54
CONFIG_DEBUG_KERNEL=y

0 commit comments

Comments
 (0)