summaryrefslogtreecommitdiff
path: root/include/linux/percpu.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-07-04 13:50:38 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2023-07-04 13:50:38 -0700
commit04f2933d375e3f90d4435b7b518d3065afd1fa25 (patch)
treec3b7cd21480755f4184a7af23219f6f30cf5b6d4 /include/linux/percpu.h
parent03275585cabd0240944f19f33d7584a1b099a3a8 (diff)
parentb5ec6fd286dfa466f64cb0e56ed768092d0342ae (diff)
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/percpu.h')
-rw-r--r--include/linux/percpu.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 42125cf9c506..b3b458442330 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -8,6 +8,7 @@
#include <linux/cpumask.h>
#include <linux/pfn.h>
#include <linux/init.h>
+#include <linux/cleanup.h>
#include <asm/percpu.h>
@@ -125,6 +126,9 @@ extern void __init setup_per_cpu_areas(void);
extern void __percpu *__alloc_percpu_gfp(size_t size, size_t align, gfp_t gfp) __alloc_size(1);
extern void __percpu *__alloc_percpu(size_t size, size_t align) __alloc_size(1);
extern void free_percpu(void __percpu *__pdata);
+
+DEFINE_FREE(free_percpu, void __percpu *, free_percpu(_T))
+
extern phys_addr_t per_cpu_ptr_to_phys(void *addr);
#define alloc_percpu_gfp(type, gfp) \