summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/pm/legacy-dpm
diff options
context:
space:
mode:
authorMario Limonciello <mario.limonciello@amd.com>2023-09-30 06:14:17 +0300
committerAlex Deucher <alexander.deucher@amd.com>2023-10-05 01:39:52 +0300
commitb8e6aec14691b44e6a26d25052a2f4fa8c5f7b28 (patch)
tree66ff7951e300071fc8dbceba98e5c47e6e3af734 /drivers/gpu/drm/amd/pm/legacy-dpm
parent7752ccf85b929a22e658ec145283e8f31232f4bb (diff)
downloadlinux-b8e6aec14691b44e6a26d25052a2f4fa8c5f7b28.tar.xz
drm/amd: Drop all hand-built MIN and MAX macros in the amdgpu base driver
Several files declare MIN() or MAX() macros that ignore the types of the values being compared. Drop these macros and switch to min() min_t(), and max() from `linux/minmax.h`. Suggested-by: Hamza Mahfooz <Hamza.Mahfooz@amd.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/legacy-dpm')
-rw-r--r--drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
index 02e69ccff3ba..fc8e4ac6c8e7 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
@@ -6600,7 +6600,7 @@ static int si_dpm_get_fan_speed_pwm(void *handle,
tmp64 = (u64)duty * 255;
do_div(tmp64, duty100);
- *speed = MIN((u32)tmp64, 255);
+ *speed = min_t(u32, tmp64, 255);
return 0;
}