Skip to content

Commit abd5173

Browse files
Luben Tuikovalexdeucher
authored andcommitted
drm/amdgpu: Fix minmax warning
Fix minmax warning by using min_t() macro and explicitly specifying the assignment type. Cc: Alex Deucher <[email protected]> Signed-off-by: Luben Tuikov <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 0317d73 commit abd5173

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,9 @@ static int smu_v13_0_irq_process(struct amdgpu_device *adev,
14361436
case 0x8:
14371437
high = smu->thermal_range.software_shutdown_temp +
14381438
smu->thermal_range.software_shutdown_temp_offset;
1439-
high = min(SMU_THERMAL_MAXIMUM_ALERT_TEMP, high);
1439+
high = min_t(typeof(high),
1440+
SMU_THERMAL_MAXIMUM_ALERT_TEMP,
1441+
high);
14401442
dev_emerg(adev->dev, "Reduce soft CTF limit to %d (by an offset %d)\n",
14411443
high,
14421444
smu->thermal_range.software_shutdown_temp_offset);
@@ -1449,8 +1451,9 @@ static int smu_v13_0_irq_process(struct amdgpu_device *adev,
14491451
WREG32_SOC15(THM, 0, regTHM_THERMAL_INT_CTRL, data);
14501452
break;
14511453
case 0x9:
1452-
high = min(SMU_THERMAL_MAXIMUM_ALERT_TEMP,
1453-
smu->thermal_range.software_shutdown_temp);
1454+
high = min_t(typeof(high),
1455+
SMU_THERMAL_MAXIMUM_ALERT_TEMP,
1456+
smu->thermal_range.software_shutdown_temp);
14541457
dev_emerg(adev->dev, "Recover soft CTF limit to %d\n", high);
14551458

14561459
data = RREG32_SOC15(THM, 0, regTHM_THERMAL_INT_CTRL);

0 commit comments

Comments
 (0)