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 10:07:47 +0300
committerAlex Deucher <alexander.deucher@amd.com>2016-05-11 19:31:23 +0300
commit354ef928a0e67166249c0136cdba21fdfef31702 (patch)
tree4e336d646b7a8e2d02e48ffb795651f676b270e1 /drivers/gpu/drm/amd/amdgpu/kv_dpm.c
parent9887e425f91b063d68ee1fbec76dea15d6a82085 (diff)
downloadlinux-354ef928a0e67166249c0136cdba21fdfef31702.tar.xz
drm/amdgpu: Simplify calculation in *get_sleep_divider_id_from_clock
a / (1 << b) is equivalent to a >> b for unsigned values 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.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
index 4bc107a4546e..bc7997b649c0 100644
--- a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
@@ -135,11 +135,6 @@ static void sumo_take_smu_control(struct amdgpu_device *adev, bool enable)
#endif
}
-static u32 sumo_get_sleep_divider_from_id(u32 id)
-{
- return 1 << id;
-}
-
static void sumo_construct_sclk_voltage_mapping_table(struct amdgpu_device *adev,
struct sumo_sclk_voltage_mapping_table *sclk_voltage_mapping_table,
ATOM_AVAILABLE_SCLK_LIST *table)
@@ -2185,7 +2180,7 @@ static u8 kv_get_sleep_divider_id_from_clock(struct amdgpu_device *adev,
return 0;
for (i = KV_MAX_DEEPSLEEP_DIVIDER_ID; i > 0; i--) {
- temp = sclk / sumo_get_sleep_divider_from_id(i);
+ temp = sclk >> i;
if (temp >= min)
break;
}