All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Huang, Tim" <Tim.Huang@amd.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>
Cc: "Deucher, Alexander" <Alexander.Deucher@amd.com>,
	"Koenig, Christian" <Christian.Koenig@amd.com>
Subject: RE: [PATCH] drm/amd/pm: fix uninitialized variable warning for smu8_hwmgr
Date: Sun, 28 Apr 2024 00:31:17 +0000	[thread overview]
Message-ID: <CH3PR12MB80748FDC7C328FCE4BD6BCDAF6142@CH3PR12MB8074.namprd12.prod.outlook.com> (raw)
In-Reply-To: <af9531ef-d623-4ef9-a93f-28796dedfa7c@gmail.com>

[AMD Official Use Only - General]

-----Original Message-----
From: Christian König <ckoenig.leichtzumerken@gmail.com>
Sent: Friday, April 26, 2024 7:39 PM
To: Huang, Tim <Tim.Huang@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>
Subject: Re: [PATCH] drm/amd/pm: fix uninitialized variable warning for smu8_hwmgr

Am 26.04.24 um 11:29 schrieb Tim Huang:
> Clear warnings that using uninitialized value level when fails to get
> the value from SMU.
>
> Signed-off-by: Tim Huang <Tim.Huang@amd.com>

> Maybe drop the blank line before the "if (ret)", apart from that

Yes, will drop it. Thanks.

Tim

> Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   .../drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c    | 18 +++++++++++++++---
>   1 file changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c
> b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c
> index b015a601b385..4e4146ce71c1 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c
> @@ -584,6 +584,7 @@ static int smu8_init_uvd_limit(struct pp_hwmgr *hwmgr)
>                               hwmgr->dyn_state.uvd_clock_voltage_dependency_table;
>       unsigned long clock = 0;
>       uint32_t level;
> +     int ret;
>
>       if (NULL == table || table->count <= 0)
>               return -EINVAL;
> @@ -591,7 +592,10 @@ static int smu8_init_uvd_limit(struct pp_hwmgr *hwmgr)
>       data->uvd_dpm.soft_min_clk = 0;
>       data->uvd_dpm.hard_min_clk = 0;
>
> -     smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxUvdLevel, &level);
> +     ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxUvdLevel, &level);
> +
> +     if (ret)
> +             return ret;
>
>       if (level < table->count)
>               clock = table->entries[level].vclk; @@ -611,6 +615,7 @@ static int
> smu8_init_vce_limit(struct pp_hwmgr *hwmgr)
>                               hwmgr->dyn_state.vce_clock_voltage_dependency_table;
>       unsigned long clock = 0;
>       uint32_t level;
> +     int ret;
>
>       if (NULL == table || table->count <= 0)
>               return -EINVAL;
> @@ -618,7 +623,10 @@ static int smu8_init_vce_limit(struct pp_hwmgr *hwmgr)
>       data->vce_dpm.soft_min_clk = 0;
>       data->vce_dpm.hard_min_clk = 0;
>
> -     smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxEclkLevel, &level);
> +     ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxEclkLevel,
> +&level);
> +
> +     if (ret)
> +             return ret;
>
>       if (level < table->count)
>               clock = table->entries[level].ecclk; @@ -638,6 +646,7 @@ static
> int smu8_init_acp_limit(struct pp_hwmgr *hwmgr)
>                               hwmgr->dyn_state.acp_clock_voltage_dependency_table;
>       unsigned long clock = 0;
>       uint32_t level;
> +     int ret;
>
>       if (NULL == table || table->count <= 0)
>               return -EINVAL;
> @@ -645,7 +654,10 @@ static int smu8_init_acp_limit(struct pp_hwmgr *hwmgr)
>       data->acp_dpm.soft_min_clk = 0;
>       data->acp_dpm.hard_min_clk = 0;
>
> -     smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxAclkLevel, &level);
> +     ret = smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetMaxAclkLevel,
> +&level);
> +
> +     if (ret)
> +             return ret;
>
>       if (level < table->count)
>               clock = table->entries[level].acpclk;


      reply	other threads:[~2024-04-28  0:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26  9:29 [PATCH] drm/amd/pm: fix uninitialized variable warning for smu8_hwmgr Tim Huang
2024-04-26 11:38 ` Christian König
2024-04-28  0:31   ` Huang, Tim [this message]

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=CH3PR12MB80748FDC7C328FCE4BD6BCDAF6142@CH3PR12MB8074.namprd12.prod.outlook.com \
    --to=tim.huang@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Christian.Koenig@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=ckoenig.leichtzumerken@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.