diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-07-04 13:50:38 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-07-04 13:50:38 -0700 |
commit | 04f2933d375e3f90d4435b7b518d3065afd1fa25 (patch) | |
tree | c3b7cd21480755f4184a7af23219f6f30cf5b6d4 /include/linux/compiler_attributes.h | |
parent | 03275585cabd0240944f19f33d7584a1b099a3a8 (diff) | |
parent | b5ec6fd286dfa466f64cb0e56ed768092d0342ae (diff) | |
download | lwn-04f2933d375e3f90d4435b7b518d3065afd1fa25.tar.gz lwn-04f2933d375e3f90d4435b7b518d3065afd1fa25.zip |
Merge tag 'core_guards_for_6.5_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue
Pull scope-based resource management infrastructure from Peter Zijlstra:
"These are the first few patches in the Scope-based Resource Management
series that introduce the infrastructure but not any conversions as of
yet.
Adding the infrastructure now allows multiple people to start using
them.
Of note is that Sparse will need some work since it doesn't yet
understand this attribute and might have decl-after-stmt issues"
* tag 'core_guards_for_6.5_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue:
kbuild: Drop -Wdeclaration-after-statement
locking: Introduce __cleanup() based infrastructure
apparmor: Free up __cleanup() name
dmaengine: ioat: Free up __cleanup() name
Diffstat (limited to 'include/linux/compiler_attributes.h')
-rw-r--r-- | include/linux/compiler_attributes.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/compiler_attributes.h b/include/linux/compiler_attributes.h index 571fa7924f74..00efa35c350f 100644 --- a/include/linux/compiler_attributes.h +++ b/include/linux/compiler_attributes.h @@ -70,6 +70,12 @@ #define __assume_aligned(a, ...) __attribute__((__assume_aligned__(a, ## __VA_ARGS__))) /* + * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-cleanup-variable-attribute + * clang: https://clang.llvm.org/docs/AttributeReference.html#cleanup + */ +#define __cleanup(func) __attribute__((__cleanup__(func))) + +/* * Note the long name. * * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-const-function-attribute |