Commit 9faa6b02 authored by Rex Zhu's avatar Rex Zhu Committed by Alex Deucher

drm/amd/powerplay: fix static checker warnings in smu7_hwmgr.c

variable dereferenced before check it
Signed-off-by: default avatarRex Zhu <Rex.Zhu@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e0705324
...@@ -3802,13 +3802,15 @@ static inline bool smu7_are_power_levels_equal(const struct smu7_performance_lev ...@@ -3802,13 +3802,15 @@ static inline bool smu7_are_power_levels_equal(const struct smu7_performance_lev
int smu7_check_states_equal(struct pp_hwmgr *hwmgr, const struct pp_hw_power_state *pstate1, const struct pp_hw_power_state *pstate2, bool *equal) int smu7_check_states_equal(struct pp_hwmgr *hwmgr, const struct pp_hw_power_state *pstate1, const struct pp_hw_power_state *pstate2, bool *equal)
{ {
const struct smu7_power_state *psa = cast_const_phw_smu7_power_state(pstate1); const struct smu7_power_state *psa;
const struct smu7_power_state *psb = cast_const_phw_smu7_power_state(pstate2); const struct smu7_power_state *psb;
int i; int i;
if (pstate1 == NULL || pstate2 == NULL || equal == NULL) if (pstate1 == NULL || pstate2 == NULL || equal == NULL)
return -EINVAL; return -EINVAL;
psa = cast_const_phw_smu7_power_state(pstate1);
psb = cast_const_phw_smu7_power_state(pstate2);
/* If the two states don't even have the same number of performance levels they cannot be the same state. */ /* If the two states don't even have the same number of performance levels they cannot be the same state. */
if (psa->performance_level_count != psb->performance_level_count) { if (psa->performance_level_count != psb->performance_level_count) {
*equal = false; *equal = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment