Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 77f7f71f authored by Alex Deucher's avatar Alex Deucher
Browse files

drm/amdgpu/powerplay/smu7: fix static checker warning



Casting of voltage values to a larger size results in
overwriting adjacent memory in the structure.

Reviewed-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 26beaee9
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -2129,13 +2129,16 @@ static int smu7_patch_acp_vddc(struct pp_hwmgr *hwmgr,
static int smu7_patch_limits_vddc(struct pp_hwmgr *hwmgr,
				  struct phm_clock_and_voltage_limits *tab)
{
	uint32_t vddc, vddci;
	struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);

	if (tab) {
		smu7_patch_ppt_v0_with_vdd_leakage(hwmgr, (uint32_t *)&tab->vddc,
		smu7_patch_ppt_v0_with_vdd_leakage(hwmgr, &vddc,
						   &data->vddc_leakage);
		smu7_patch_ppt_v0_with_vdd_leakage(hwmgr, (uint32_t *)&tab->vddci,
		tab->vddc = vddc;
		smu7_patch_ppt_v0_with_vdd_leakage(hwmgr, &vddci,
						   &data->vddci_leakage);
		tab->vddci = vddci;
	}

	return 0;