drm/amdgpu: Fix minmax warning
Subsystems (3)
PATCH 1/1 drm/amdgpu: Fix minmax warning
Fix minmax warning by using min_t() macro and
explicitly specifying the assignment type.
Signed-off-by Luben Tuikov <[email protected]>
--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +6 -3
@@ -1436,7 +1436,9 @@ static int smu_v13_0_irq_process(struct amdgpu_device *adev,case 0x8 : high = smu->thermal_range.software_shutdown_temp + smu->thermal_range.software_shutdown_temp_offset; - high =min (SMU_THERMAL_MAXIMUM_ALERT_TEMP , high); + high =min_t (typeof (high), +SMU_THERMAL_MAXIMUM_ALERT_TEMP , + high);dev_emerg (adev->dev,"Reduce soft CTF limit to %d (by an offset %d)\n" , high, smu->thermal_range.software_shutdown_temp_offset);
@@ -1449,8 +1451,9 @@ static int smu_v13_0_irq_process(struct amdgpu_device *adev,WREG32_SOC15 (THM ,0 , regTHM_THERMAL_INT_CTRL, data);break ;case 0x9 : - high =min (SMU_THERMAL_MAXIMUM_ALERT_TEMP , - smu->thermal_range.software_shutdown_temp); + high =min_t (typeof (high), +SMU_THERMAL_MAXIMUM_ALERT_TEMP , + smu->thermal_range.software_shutdown_temp);dev_emerg (adev->dev,"Recover soft CTF limit to %d\n" , high); data =RREG32_SOC15 (THM ,0 , regTHM_THERMAL_INT_CTRL);
base-commit: 51005ef41b7e91d1e24e2defec22bc4f1eeb7040
Signature · 1 line
2.38.1
Quoted 5 lines · Luben Tuikov
Fix minmax warning by using
min_t()macro and
explicitly specifying the assignment type.Signed-off-by Luben Tuikov <[email protected]>
Reviewed-by Alex Deucher <[email protected]>
Quoted 36 lines
--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +6
-3@@ -1436,7 +1436,9 @@ static int smu_v13_0_irq_process(struct amdgpu_device *adev,case 0x8 : high = smu->thermal_range.software_shutdown_temp + smu->thermal_range.software_shutdown_temp_offset; - high =min (SMU_THERMAL_MAXIMUM_ALERT_TEMP , high); + high =min_t (typeof (high), +SMU_THERMAL_MAXIMUM_ALERT_TEMP , + high);dev_emerg (adev->dev,"Reduce soft CTF limit to %d (by an offset %d)\n" , high, smu->thermal_range.software_shutdown_temp_offset);@@ -1449,8 +1451,9 @@ static int smu_v13_0_irq_process(struct amdgpu_device *adev,WREG32_SOC15 (THM ,0 , regTHM_THERMAL_INT_CTRL, data);break ;case 0x9 : - high =min (SMU_THERMAL_MAXIMUM_ALERT_TEMP , - smu->thermal_range.software_shutdown_temp); + high =min_t (typeof (high), +SMU_THERMAL_MAXIMUM_ALERT_TEMP , + smu->thermal_range.software_shutdown_temp);dev_emerg (adev->dev,"Recover soft CTF limit to %d\n" , high); data =RREG32_SOC15 (THM ,0 , regTHM_THERMAL_INT_CTRL);base-commit:
51005ef41b7e91d1e24e2defec22bc4f1eeb7040--
2.38.1