summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
diff options
context:
space:
mode:
authorRex Zhu2016-10-17 12:15:26 +0200
committerAlex Deucher2016-10-21 17:19:07 +0200
commit51585e03f5b26521d7840c06f4807ee62b23af3a (patch)
tree0ba9946ec6d1748dac8181f44c3a7fa3ef467122 /drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
parentdrm/amdgpu: avoid drm error log during S3 on RHEL7.3 (diff)
downloadkernel-qcow2-linux-51585e03f5b26521d7840c06f4807ee62b23af3a.tar.gz
kernel-qcow2-linux-51585e03f5b26521d7840c06f4807ee62b23af3a.tar.xz
kernel-qcow2-linux-51585e03f5b26521d7840c06f4807ee62b23af3a.zip
drm/amd/powerplay: fix static checker warning in process_pptables_v1_0.c
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
index 7de701d8a450..4477c55a58e3 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c
@@ -1201,12 +1201,15 @@ static uint32_t make_classification_flags(struct pp_hwmgr *hwmgr,
static int ppt_get_num_of_vce_state_table_entries_v1_0(struct pp_hwmgr *hwmgr)
{
const ATOM_Tonga_POWERPLAYTABLE *pp_table = get_powerplay_table(hwmgr);
- const ATOM_Tonga_VCE_State_Table *vce_state_table =
- (ATOM_Tonga_VCE_State_Table *)(((unsigned long)pp_table) + le16_to_cpu(pp_table->usVCEStateTableOffset));
+ const ATOM_Tonga_VCE_State_Table *vce_state_table;
- if (vce_state_table == NULL)
+
+ if (pp_table == NULL)
return 0;
+ vce_state_table = (void *)pp_table +
+ le16_to_cpu(pp_table->usVCEStateTableOffset);
+
return vce_state_table->ucNumEntries;
}