From: Tom Rix Date: Mon, 24 Jan 2022 20:18:12 +0000 (-0800) Subject: drm/amd/pm: return -ENOTSUPP if there is no get_dpm_ultimate_freq function X-Git-Tag: v5.18-rc1~134^2~18^2~164 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=430e6a0212b2a0eb1de5e9d47a016fa79edf3978;p=thirdparty%2Flinux.git drm/amd/pm: return -ENOTSUPP if there is no get_dpm_ultimate_freq function clang static analysis reports this represenative problem amdgpu_smu.c:144:18: warning: The left operand of '*' is a garbage value return clk_freq * 100; ~~~~~~~~ ^ If there is no get_dpm_ultimate_freq function, smu_get_dpm_freq_range returns success without setting the output min,max parameters. So return an -ENOTSUPP error. Fixes: e5ef784b1e17 ("drm/amd/powerplay: revise calling chain on retrieving frequency range") Signed-off-by: Tom Rix Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index 5ace30434e603..264eb09ccfd51 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -116,7 +116,7 @@ int smu_get_dpm_freq_range(struct smu_context *smu, uint32_t *min, uint32_t *max) { - int ret = 0; + int ret = -ENOTSUPP; if (!min && !max) return -EINVAL;