[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_M+xmJkiMkug=5bix8ypxHzr0embK7GN4GRY57BK1y4FA@mail.gmail.com>
Date: Mon, 24 Jan 2022 17:08:28 -0500
From: Alex Deucher <alexdeucher@...il.com>
To: Tom Rix <trix@...hat.com>
Cc: "Quan, Evan" <evan.quan@....com>,
"Deucher, Alexander" <alexander.deucher@....com>,
Christian Koenig <christian.koenig@....com>,
xinhui pan <Xinhui.Pan@....com>,
Dave Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
"Lazar, Lijo" <lijo.lazar@....com>,
"Powell, Darren" <darren.powell@....com>,
"Chen, Guchun" <guchun.chen@....com>,
Arunpravin <Arunpravin.PaneerSelvam@....com>,
Andrey Grodzovsky <andrey.grodzovsky@....com>,
llvm@...ts.linux.dev,
Maling list - DRI developers
<dri-devel@...ts.freedesktop.org>,
amd-gfx list <amd-gfx@...ts.freedesktop.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] drm/amd/pm: return -ENOTSUPP if there is no
get_dpm_ultimate_freq function
Applied. Thanks!
Alex
On Mon, Jan 24, 2022 at 3:18 PM <trix@...hat.com> wrote:
>
> From: Tom Rix <trix@...hat.com>
>
> 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 <trix@...hat.com>
> ---
> v2: return error instead of initializing min/max
>
> drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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;
> --
> 2.26.3
>
Powered by blists - more mailing lists