summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
diff options
context:
space:
mode:
authorNils Wallménius <nils.wallmenius@gmail.com>2016-05-05 09:07:46 +0200
committerAlex Deucher <alexander.deucher@amd.com>2016-05-11 12:31:23 -0400
commit9887e425f91b063d68ee1fbec76dea15d6a82085 (patch)
treeafc09c764d8a74ba359a207d9d87099a1318cb84 /drivers/gpu/drm/amd/amdgpu/kv_dpm.c
parent859b8b6a27eb6f22d082282f5fd234d6323f849d (diff)
drm/amdgpu: Use max macro in *get_sleep_divider_id_from_clock
Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/kv_dpm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/kv_dpm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
index 4bd1e551cccd..4bc107a4546e 100644
--- a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
@@ -2176,8 +2176,7 @@ static u8 kv_get_sleep_divider_id_from_clock(struct amdgpu_device *adev,
struct kv_power_info *pi = kv_get_pi(adev);
u32 i;
u32 temp;
- u32 min = (min_sclk_in_sr > KV_MINIMUM_ENGINE_CLOCK) ?
- min_sclk_in_sr : KV_MINIMUM_ENGINE_CLOCK;
+ u32 min = max(min_sclk_in_sr, (u32)KV_MINIMUM_ENGINE_CLOCK);
if (sclk < min)
return 0;