diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 11:02:58 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 11:02:58 -0800 |
| commit | 8934827db5403eae57d4537114a9ff88b0a8460f (patch) | |
| tree | 5167aa7e16b786b9135e19d508b234054fa6e8ce /drivers/gpu/drm/amd/ras | |
| parent | c7decec2f2d2ab0366567f9e30c0e1418cece43f (diff) | |
| parent | 7a70c15bd1449f1eb30991772edce37b41e496fb (diff) | |
Merge tag 'kmalloc_obj-treewide-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linuxHEADmaster
Pull kmalloc_obj conversion from Kees Cook:
"This does the tree-wide conversion to kmalloc_obj() and friends using
coccinelle, with a subsequent small manual cleanup of whitespace
alignment that coccinelle does not handle.
This uncovered a clang bug in __builtin_counted_by_ref(), so the
conversion is preceded by disabling that for current versions of
clang. The imminent clang 22.1 release has the fix.
I've done allmodconfig build tests for x86_64, arm64, i386, and arm. I
did defconfig builds for alpha, m68k, mips, parisc, powerpc, riscv,
s390, sparc, sh, arc, csky, xtensa, hexagon, and openrisc"
* tag 'kmalloc_obj-treewide-v7.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
kmalloc_obj: Clean up after treewide replacements
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
compiler_types: Disable __builtin_counted_by_ref for Clang
Diffstat (limited to 'drivers/gpu/drm/amd/ras')
| -rw-r--r-- | drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c | 5 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/ras/rascore/ras_core.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/ras/rascore/ras_log_ring.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/ras/rascore/ras_umc.c | 9 |
5 files changed, 11 insertions, 11 deletions
diff --git a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c index 59c063625920..611171fea3cb 100644 --- a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c +++ b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_ras_mgr.c @@ -299,7 +299,7 @@ static int amdgpu_ras_mgr_sw_init(struct amdgpu_ip_block *ip_block) if (!con->uniras_enabled) return 0; - ras_mgr = kzalloc(sizeof(*ras_mgr), GFP_KERNEL); + ras_mgr = kzalloc_obj(*ras_mgr, GFP_KERNEL); if (!ras_mgr) return -EINVAL; diff --git a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c index a75479593864..65223bfec688 100644 --- a/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c +++ b/drivers/gpu/drm/amd/ras/ras_mgr/amdgpu_virt_ras_cmd.c @@ -195,7 +195,7 @@ static int amdgpu_virt_ras_get_cper_records(struct ras_core_context *ras_core, if (!req->buf_size || !req->buf_ptr || !req->cper_num) return RAS_CMD__ERROR_INVALID_INPUT_DATA; - trace = kcalloc(MAX_RECORD_PER_BATCH, sizeof(*trace), GFP_KERNEL); + trace = kzalloc_objs(*trace, MAX_RECORD_PER_BATCH, GFP_KERNEL); if (!trace) return RAS_CMD__ERROR_GENERIC; @@ -365,7 +365,8 @@ int amdgpu_virt_ras_sw_init(struct amdgpu_device *adev) { struct amdgpu_ras_mgr *ras_mgr = amdgpu_ras_mgr_get_context(adev); - ras_mgr->virt_ras_cmd = kzalloc(sizeof(struct amdgpu_virt_ras_cmd), GFP_KERNEL); + ras_mgr->virt_ras_cmd = kzalloc_obj(struct amdgpu_virt_ras_cmd, + GFP_KERNEL); if (!ras_mgr->virt_ras_cmd) return -ENOMEM; diff --git a/drivers/gpu/drm/amd/ras/rascore/ras_core.c b/drivers/gpu/drm/amd/ras/rascore/ras_core.c index f2fccdf5e329..e4a6f6cfd2d5 100644 --- a/drivers/gpu/drm/amd/ras/rascore/ras_core.c +++ b/drivers/gpu/drm/amd/ras/rascore/ras_core.c @@ -263,11 +263,11 @@ struct ras_core_context *ras_core_create(struct ras_core_config *init_config) struct ras_core_context *ras_core; struct ras_core_config *config; - ras_core = kzalloc(sizeof(*ras_core), GFP_KERNEL); + ras_core = kzalloc_obj(*ras_core, GFP_KERNEL); if (!ras_core) return NULL; - config = kzalloc(sizeof(*config), GFP_KERNEL); + config = kzalloc_obj(*config, GFP_KERNEL); if (!config) { kfree(ras_core); return NULL; diff --git a/drivers/gpu/drm/amd/ras/rascore/ras_log_ring.c b/drivers/gpu/drm/amd/ras/rascore/ras_log_ring.c index 0a838fdcb2f6..5d3e46c7740f 100644 --- a/drivers/gpu/drm/amd/ras/rascore/ras_log_ring.c +++ b/drivers/gpu/drm/amd/ras/rascore/ras_log_ring.c @@ -202,7 +202,7 @@ struct ras_log_batch_tag *ras_log_ring_create_batch_tag(struct ras_core_context struct ras_log_batch_tag *batch_tag; unsigned long flags = 0; - batch_tag = kzalloc(sizeof(*batch_tag), GFP_KERNEL); + batch_tag = kzalloc_obj(*batch_tag, GFP_KERNEL); if (!batch_tag) return NULL; diff --git a/drivers/gpu/drm/amd/ras/rascore/ras_umc.c b/drivers/gpu/drm/amd/ras/rascore/ras_umc.c index b19c26f6feaf..7c69a7a8c5f6 100644 --- a/drivers/gpu/drm/amd/ras/rascore/ras_umc.c +++ b/drivers/gpu/drm/amd/ras/rascore/ras_umc.c @@ -199,7 +199,7 @@ int ras_umc_log_bad_bank_pending(struct ras_core_context *ras_core, struct ras_b struct ras_umc *ras_umc = &ras_core->ras_umc; struct ras_bank_ecc_node *ecc_node; - ecc_node = kzalloc(sizeof(*ecc_node), GFP_KERNEL); + ecc_node = kzalloc_obj(*ecc_node, GFP_KERNEL); if (!ecc_node) return -ENOMEM; @@ -246,7 +246,7 @@ int ras_umc_log_bad_bank(struct ras_core_context *ras_core, struct ras_bank_ecc if (ret) goto out; - err_rec = kzalloc(sizeof(*err_rec), GFP_KERNEL); + err_rec = kzalloc_obj(*err_rec, GFP_KERNEL); if (!err_rec) { ret = -ENOMEM; goto out; @@ -454,7 +454,7 @@ int ras_umc_load_bad_pages(struct ras_core_context *ras_core) ras_core->ras_eeprom.record_threshold_config == DISABLE_RETIRE_PAGE) return 0; - bps = kcalloc(ras_num_recs, sizeof(*bps), GFP_KERNEL); + bps = kzalloc_objs(*bps, ras_num_recs, GFP_KERNEL); if (!bps) return -ENOMEM; @@ -512,8 +512,7 @@ int ras_umc_handle_bad_pages(struct ras_core_context *ras_core, void *data) struct eeprom_umc_record *records; int count, ret; - records = kcalloc(MAX_ECC_NUM_PER_RETIREMENT, - sizeof(*records), GFP_KERNEL); + records = kzalloc_objs(*records, MAX_ECC_NUM_PER_RETIREMENT, GFP_KERNEL); if (!records) return -ENOMEM; |
