summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c
diff options
context:
space:
mode:
authorNils Wallménius <nils.wallmenius@gmail.com>2016-05-05 10:07:46 +0300
committerAlex Deucher <alexander.deucher@amd.com>2016-05-11 19:31:23 +0300
commit9887e425f91b063d68ee1fbec76dea15d6a82085 (patch)
treeafc09c764d8a74ba359a207d9d87099a1318cb84 /drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c
parent859b8b6a27eb6f22d082282f5fd234d6323f849d (diff)
downloadlinux-9887e425f91b063d68ee1fbec76dea15d6a82085.tar.xz
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/powerplay/hwmgr/tonga_hwmgr.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c
index d79af48ca9a5..8969f1ef1de5 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c
@@ -2420,8 +2420,7 @@ static uint8_t tonga_get_sleep_divider_id_from_clock(struct pp_hwmgr *hwmgr,
uint32_t engine_clock, uint32_t min_engine_clock_in_sr)
{
uint32_t i, temp;
- uint32_t min = (min_engine_clock_in_sr > TONGA_MINIMUM_ENGINE_CLOCK) ?
- min_engine_clock_in_sr : TONGA_MINIMUM_ENGINE_CLOCK;
+ uint32_t min = max(min_engine_clock_in_sr, (uint32_t)TONGA_MINIMUM_ENGINE_CLOCK);
PP_ASSERT_WITH_CODE((engine_clock >= min),
"Engine clock can't satisfy stutter requirement!", return 0);