mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: Dan Carpenter <error27@gmail.com>, Asad Kamal <asad.kamal@amd.com>
Cc: "Kenneth Feng" <kenneth.feng@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Yang Wang" <kevinyang.wang@amd.com>,
	"Hawking Zhang" <Hawking.Zhang@amd.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] drm/amd/pm: silence uninitialized variable warnings
Date: Mon, 10 Aug 2026 10:11:00 +0530	[thread overview]
Message-ID: <77e1ef2b-24ab-4492-bc91-08c01f012a46@amd.com> (raw)
In-Reply-To: <aneGaKJUl_Jyu05n@stanley.mountain>



On 09-Aug-26 1:11 AM, Dan Carpenter wrote:
> Smatch complains that:
> 
>      drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu15/smu_v15_0_8_ppt.c:1964
>      smu_v15_0_8_set_performance_level() error: uninitialized symbol 'ret'.
> 
> In this line there is an "if (ret)" condition where "ret" is either
> zero or uninitialized.  Initialize "ret" at the start of the function to
> avoid a potential uninitialized variable bug.  But also delete the
> condition since it is never true.
> 
> Fixes: 422b399b09c7 ("drm/amd/pm: Add od_edit_dpm_table support")
> Signed-off-by: Dan Carpenter <error27@gmail.com>

Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>

Thanks,
Lijo

> ---
>   drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c
> index 59fdd2319b66..c78e611d2a25 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c
> @@ -1920,7 +1920,7 @@ static int smu_v15_0_8_set_performance_level(struct smu_context *smu,
>   	struct smu_dpm_table *gfx_table = &dpm_context->dpm_tables.gfx_table;
>   	struct smu_dpm_table *uclk_table = &dpm_context->dpm_tables.uclk_table;
>   	struct smu_umd_pstate_table *pstate_table = &smu->pstate_table;
> -	int ret;
> +	int ret = 0;
>   
>   	switch (level) {
>   	case AMD_DPM_FORCED_LEVEL_PERF_DETERMINISM:
> @@ -1961,9 +1961,6 @@ static int smu_v15_0_8_set_performance_level(struct smu_context *smu,
>   				SMU_DPM_TABLE_MAX(uclk_table);
>   		}
>   
> -		if (ret)
> -			goto out;
> -
>   		smu_cmn_reset_custom_level(smu);
>   
>   		break;


  reply	other threads:[~2026-08-10  4:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-08 19:41 Dan Carpenter
2026-08-10  4:41 ` Lazar, Lijo [this message]
2026-08-10 15:19   ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=77e1ef2b-24ab-4492-bc91-08c01f012a46@amd.com \
    --to=lijo.lazar@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=asad.kamal@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=error27@gmail.com \
    --cc=kenneth.feng@amd.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kevinyang.wang@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=simona@ffwll.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®