Re: [PATCH 01/40] drm/amd/pm/powerplay/smumgr/tonga_smumgr: Remove set but unused variable 'res'

From: Alex Deucher
Date: Mon Nov 30 2020 - 18:10:03 EST


On Thu, Nov 26, 2020 at 8:42 AM Lee Jones <lee.jones@xxxxxxxxxx> wrote:
>
> Fixes the following W=1 kernel build warning(s):
>
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/tonga_smumgr.c: In function ‘tonga_thermal_setup_fan_table’:
> drivers/gpu/drm/amd/amdgpu/../pm/powerplay/smumgr/tonga_smumgr.c:2469:6: warning: variable ‘res’ set but not used [-Wunused-but-set-variable]
>
> Cc: Evan Quan <evan.quan@xxxxxxx>
> Cc: Alex Deucher <alexander.deucher@xxxxxxx>
> Cc: "Christian König" <christian.koenig@xxxxxxx>
> Cc: David Airlie <airlied@xxxxxxxx>
> Cc: Daniel Vetter <daniel@xxxxxxxx>
> Cc: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>
> ---
> drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c
> index 4bfadb49521bc..c28f3e1299701 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/tonga_smumgr.c
> @@ -2466,7 +2466,6 @@ static int tonga_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
> uint32_t t_diff1, t_diff2, pwm_diff1, pwm_diff2;
> uint16_t fdo_min, slope1, slope2;
> uint32_t reference_clock;
> - int res;
> uint64_t tmp64;
>
> if (!phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
> @@ -2539,11 +2538,9 @@ static int tonga_thermal_setup_fan_table(struct pp_hwmgr *hwmgr)
>
> fan_table.FanControl_GL_Flag = 1;
>
> - res = smu7_copy_bytes_to_smc(hwmgr,
> - smu_data->smu7_data.fan_table_start,
> - (uint8_t *)&fan_table,
> - (uint32_t)sizeof(fan_table),
> - SMC_RAM_END);
> + smu7_copy_bytes_to_smc(hwmgr, smu_data->smu7_data.fan_table_start,
> + (uint8_t *)&fan_table,
> + (uint32_t)sizeof(fan_table), SMC_RAM_END);
>

We should probably return the error here rather than dropping it.
I'll send out a patch.

Thanks,

Alex


> return 0;
> }
> --
> 2.25.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/dri-devel