[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <71d72dc4-5dae-2ae4-9f10-89cca72458da@huawei.com>
Date: Mon, 18 Nov 2019 15:16:32 +0800
From: Chen Wandun <chenwandun@...wei.com>
To: "Quan, Evan" <Evan.Quan@....com>,
"Deucher, Alexander" <Alexander.Deucher@....com>,
"amd-gfx@...ts.freedesktop.org" <amd-gfx@...ts.freedesktop.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/amd/powerplay: remove variable 'result' set but not
used
OK, it indeed should return the 'result' to caller,
I will make a modification and repost the patch.
Thanks
Chen Wandun
On 2019/11/18 14:50, Quan, Evan wrote:
> Thanks. But it's better to return the 'result' out on 'result != 0'.
>
> Regards,
> Evan
> -----Original Message-----
> From: Chen Wandun <chenwandun@...wei.com>
> Sent: Saturday, November 16, 2019 11:43 AM
> To: Deucher, Alexander <Alexander.Deucher@....com>; Quan, Evan <Evan.Quan@....com>; amd-gfx@...ts.freedesktop.org; dri-devel@...ts.freedesktop.org; linux-kernel@...r.kernel.org
> Cc: chenwandun@...wei.com
> Subject: [PATCH] drm/amd/powerplay: remove variable 'result' set but not used
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vegam_smumgr.c: In function vegam_populate_smc_boot_level:
> drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vegam_smumgr.c:1364:6: warning: variable result set but not used [-Wunused-but-set-variable]
>
> Signed-off-by: Chen Wandun <chenwandun@...wei.com>
> ---
> drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 13 ++++++-------
> 1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c
> index 2068eb0..fad78bf 100644
> --- a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c
> @@ -1361,20 +1361,19 @@ static int vegam_populate_smc_uvd_level(struct pp_hwmgr *hwmgr,
> static int vegam_populate_smc_boot_level(struct pp_hwmgr *hwmgr,
> struct SMU75_Discrete_DpmTable *table)
> {
> - int result = 0;
> struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
>
> table->GraphicsBootLevel = 0;
> table->MemoryBootLevel = 0;
>
> /* find boot level from dpm table */
> - result = phm_find_boot_level(&(data->dpm_table.sclk_table),
> - data->vbios_boot_state.sclk_bootup_value,
> - (uint32_t *)&(table->GraphicsBootLevel));
> + phm_find_boot_level(&(data->dpm_table.sclk_table),
> + data->vbios_boot_state.sclk_bootup_value,
> + (uint32_t *)&(table->GraphicsBootLevel));
>
> - result = phm_find_boot_level(&(data->dpm_table.mclk_table),
> - data->vbios_boot_state.mclk_bootup_value,
> - (uint32_t *)&(table->MemoryBootLevel));
> + phm_find_boot_level(&(data->dpm_table.mclk_table),
> + data->vbios_boot_state.mclk_bootup_value,
> + (uint32_t *)&(table->MemoryBootLevel));
>
> table->BootVddc = data->vbios_boot_state.vddc_bootup_value *
> VOLTAGE_SCALE;
>
Powered by blists - more mailing lists