]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - drivers/gpu/drm/amd/amdgpu/ci_dpm.c
treewide: kzalloc() -> kcalloc()
[mirror_ubuntu-hirsute-kernel.git] / drivers / gpu / drm / amd / amdgpu / ci_dpm.c
index a266dcf5daed2f7d7b335d9c7108623eead51886..7fbad2f5f0bd7bbe76a7518b0c49bbed6e010602 100644 (file)
@@ -5679,8 +5679,9 @@ static int ci_parse_power_table(struct amdgpu_device *adev)
                (mode_info->atom_context->bios + data_offset +
                 le16_to_cpu(power_info->pplib.usNonClockInfoArrayOffset));
 
-       adev->pm.dpm.ps = kzalloc(sizeof(struct amdgpu_ps) *
-                                 state_array->ucNumEntries, GFP_KERNEL);
+       adev->pm.dpm.ps = kcalloc(state_array->ucNumEntries,
+                                 sizeof(struct amdgpu_ps),
+                                 GFP_KERNEL);
        if (!adev->pm.dpm.ps)
                return -ENOMEM;
        power_state_offset = (u8 *)state_array->states;
@@ -5927,7 +5928,9 @@ static int ci_dpm_init(struct amdgpu_device *adev)
        ci_set_private_data_variables_based_on_pptable(adev);
 
        adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries =
-               kzalloc(4 * sizeof(struct amdgpu_clock_voltage_dependency_entry), GFP_KERNEL);
+               kcalloc(4,
+                       sizeof(struct amdgpu_clock_voltage_dependency_entry),
+                       GFP_KERNEL);
        if (!adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries) {
                ci_dpm_fini(adev);
                return -ENOMEM;