linux/drivers/gpu/drm/ttm
Kees Cook 69050f8d6d treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook <kees@kernel.org>
History 2026-02-21 01:02:28 -08:00
..
tests treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
Makefile drm/ttm: Provide a shmem backup implementation 2025-03-05 17:08:59 +01:00
ttm_agp_backend.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
ttm_backup.c mm: update shmem_[kernel]_file_*() functions to use vma_flags_t 2026-02-12 15:42:58 -08:00
ttm_bo.c drm/ttm: Tidy usage of local variables a little bit 2025-12-03 14:48:47 +00:00
ttm_bo_internal.h drm/ttm: rename ttm_bo_put to _fini v3 2025-09-17 14:03:21 +02:00
ttm_bo_util.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
ttm_bo_vm.c drm-misc-next for 6.19: 2025-12-26 18:15:33 +10:00
ttm_device.c drm/ttm: Tidy ttm_operation_ctx initialization 2025-12-03 14:48:41 +00:00
ttm_execbuf_util.c drm/ttm: Include <linux/export.h> 2025-06-16 09:02:44 +02:00
ttm_module.c drm/ttm: add pgprot handling for RISC-V 2025-10-28 09:19:46 +01:00
ttm_module.h drm/ttm: add ttm_sys_manager v3 2021-05-03 12:50:41 +02:00
ttm_pool.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
ttm_pool_internal.h drm/ttm: Allow drivers to specify maximum beneficial TTM pool size 2025-10-31 09:14:50 +00:00
ttm_range_manager.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
ttm_resource.c drm/ttm: Tidy usage of local variables a little bit 2025-12-03 14:48:47 +00:00
ttm_sys_manager.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
ttm_tt.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00