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: Remove unused devm_free_percpu()

Remove unused devm_free_percpu().

By the way, it was never used in the drivers/ from day 1.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20251111145046.997309-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Danilo Krummrich <dakr@kernel.org>

authored by

Andy Shevchenko and committed by
Danilo Krummrich
4d24145a e4addc7c

-27
-1
Documentation/driver-api/driver-model/devres.rst
··· 383 383 384 384 PER-CPU MEM 385 385 devm_alloc_percpu() 386 - devm_free_percpu() 387 386 388 387 PCI 389 388 devm_pci_alloc_host_bridge() : managed PCI host bridge allocation
-25
drivers/base/devres.c
··· 1222 1222 free_percpu(p); 1223 1223 } 1224 1224 1225 - static int devm_percpu_match(struct device *dev, void *data, void *p) 1226 - { 1227 - struct devres *devr = container_of(data, struct devres, data); 1228 - 1229 - return *(void **)devr->data == p; 1230 - } 1231 - 1232 1225 /** 1233 1226 * __devm_alloc_percpu - Resource-managed alloc_percpu 1234 1227 * @dev: Device to allocate per-cpu memory for ··· 1257 1264 return pcpu; 1258 1265 } 1259 1266 EXPORT_SYMBOL_GPL(__devm_alloc_percpu); 1260 - 1261 - /** 1262 - * devm_free_percpu - Resource-managed free_percpu 1263 - * @dev: Device this memory belongs to 1264 - * @pdata: Per-cpu memory to free 1265 - * 1266 - * Free memory allocated with devm_alloc_percpu(). 1267 - */ 1268 - void devm_free_percpu(struct device *dev, void __percpu *pdata) 1269 - { 1270 - /* 1271 - * Use devres_release() to prevent memory leakage as 1272 - * devm_free_pages() does. 1273 - */ 1274 - WARN_ON(devres_release(dev, devm_percpu_release, devm_percpu_match, 1275 - (void *)(__force unsigned long)pdata)); 1276 - } 1277 - EXPORT_SYMBOL_GPL(devm_free_percpu);
-1
include/linux/device.h
··· 298 298 299 299 void __percpu *__devm_alloc_percpu(struct device *dev, size_t size, 300 300 size_t align); 301 - void devm_free_percpu(struct device *dev, void __percpu *pdata); 302 301 303 302 struct device_dma_parameters { 304 303 /*