aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2016-10-11 06:51:16 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-10-13 18:25:50 -0400
commit9faa6b0277fab4ab91db4d69bc47566fdfbae48b (patch)
treec2b3ae4dbda6402d102a4ea05f603d02aea4de63
parente07053241b0264e7b107b2b3f4d899635985d353 (diff)
drm/amd/powerplay: fix static checker warnings in smu7_hwmgr.c
variable dereferenced before check it 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>
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index 508245d49d33..7c67a5a91182 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -3802,13 +3802,15 @@ static inline bool smu7_are_power_levels_equal(const struct smu7_performance_lev
3802 3802
3803int smu7_check_states_equal(struct pp_hwmgr *hwmgr, const struct pp_hw_power_state *pstate1, const struct pp_hw_power_state *pstate2, bool *equal) 3803int smu7_check_states_equal(struct pp_hwmgr *hwmgr, const struct pp_hw_power_state *pstate1, const struct pp_hw_power_state *pstate2, bool *equal)
3804{ 3804{
3805 const struct smu7_power_state *psa = cast_const_phw_smu7_power_state(pstate1); 3805 const struct smu7_power_state *psa;
3806 const struct smu7_power_state *psb = cast_const_phw_smu7_power_state(pstate2); 3806 const struct smu7_power_state *psb;
3807 int i; 3807 int i;
3808 3808
3809 if (pstate1 == NULL || pstate2 == NULL || equal == NULL) 3809 if (pstate1 == NULL || pstate2 == NULL || equal == NULL)
3810 return -EINVAL; 3810 return -EINVAL;
3811 3811
3812 psa = cast_const_phw_smu7_power_state(pstate1);
3813 psb = cast_const_phw_smu7_power_state(pstate2);
3812 /* If the two states don't even have the same number of performance levels they cannot be the same state. */ 3814 /* If the two states don't even have the same number of performance levels they cannot be the same state. */
3813 if (psa->performance_level_count != psb->performance_level_count) { 3815 if (psa->performance_level_count != psb->performance_level_count) {
3814 *equal = false; 3816 *equal = false;