Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

devres: Move devm_alloc_percpu() and related to devres.h

Move devm_alloc_percpu() and related to devres.h where it belongs.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20251111145046.997309-3-andriy.shevchenko@linux.intel.com
[ Fix minor typo in commit message. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>

authored by

Andy Shevchenko and committed by
Danilo Krummrich
0a75f3d9 4d24145a

+17 -18
-18
include/linux/device.h
··· 281 281 void device_remove_bin_file(struct device *dev, 282 282 const struct bin_attribute *attr); 283 283 284 - /** 285 - * devm_alloc_percpu - Resource-managed alloc_percpu 286 - * @dev: Device to allocate per-cpu memory for 287 - * @type: Type to allocate per-cpu memory for 288 - * 289 - * Managed alloc_percpu. Per-cpu memory allocated with this function is 290 - * automatically freed on driver detach. 291 - * 292 - * RETURNS: 293 - * Pointer to allocated memory on success, NULL on failure. 294 - */ 295 - #define devm_alloc_percpu(dev, type) \ 296 - ((typeof(type) __percpu *)__devm_alloc_percpu((dev), sizeof(type), \ 297 - __alignof__(type))) 298 - 299 - void __percpu *__devm_alloc_percpu(struct device *dev, size_t size, 300 - size_t align); 301 - 302 284 struct device_dma_parameters { 303 285 /* 304 286 * a low level driver may set these to teach IOMMU code about
+17
include/linux/device/devres.h
··· 9 9 #include <linux/stdarg.h> 10 10 #include <linux/types.h> 11 11 #include <asm/bug.h> 12 + #include <asm/percpu.h> 12 13 13 14 struct device; 14 15 struct device_node; ··· 96 95 devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt, va_list ap); 97 96 char * __printf(3, 4) __malloc 98 97 devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt, ...); 98 + 99 + /** 100 + * devm_alloc_percpu - Resource-managed alloc_percpu 101 + * @dev: Device to allocate per-cpu memory for 102 + * @type: Type to allocate per-cpu memory for 103 + * 104 + * Managed alloc_percpu. Per-cpu memory allocated with this function is 105 + * automatically freed on driver detach. 106 + * 107 + * RETURNS: 108 + * Pointer to allocated memory on success, NULL on failure. 109 + */ 110 + #define devm_alloc_percpu(dev, type) \ 111 + ((typeof(type) __percpu *)__devm_alloc_percpu((dev), sizeof(type), __alignof__(type))) 112 + 113 + void __percpu *__devm_alloc_percpu(struct device *dev, size_t size, size_t align); 99 114 100 115 unsigned long devm_get_free_pages(struct device *dev, gfp_t gfp_mask, unsigned int order); 101 116 void devm_free_pages(struct device *dev, unsigned long addr);