drm/amd/powerplay: remove variable 'result' set but not used
Subsystems (2)
PATCH 1/1 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]
--- drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c +6 -7
@@ -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 ;
Signature · 1 line
2.7.4
Thanks. But it's better to return the 'result' out on 'result != 0'.
Regards,
Evan
-----Original Message-----
From: Chen Wandun <[email protected]>
Sent: Saturday, November 16, 2019 11:43 AM
To: Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]
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]
--- drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c +6 -7
@@ -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 ;
Signature · 1 line
2.7.4
OK, it indeed should return the 'result' to caller, I will make a modification and repost the patch.
Thanks
Chen Wandun
Quoted 53 lines · Evan
Thanks. But it's better to return the 'result' out on 'result != 0'.
Regards,
Evan
-----Original Message-----
From: Chen Wandun <[email protected]>
Sent: Saturday, November 16, 2019 11:43 AM
To: Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: [email protected]
Subject: [PATCH] drm/amd/powerplay: remove variable 'result' set but not usedFixes gcc '-Wunused-but-set-variable' warning:
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vegam_smumgr.c: In functionvegam_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 <[email protected]>--- drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c +6
-7@@ -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 ;
PATCH v2 1/1 drm/amd/powerplay: return errno code to caller when error occur
In reply to Chen Wandunreturn errno code to caller when error occur, and meanwhile remove 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]
--- drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c +5 -0
@@ -1371,11 +1371,16 @@ static int vegam_populate_smc_boot_level(struct pp_hwmgr *hwmgr, result =phm_find_boot_level (&(data->dpm_table.sclk_table), data->vbios_boot_state.sclk_bootup_value, (uint32_t *)&(table->GraphicsBootLevel)); +if (result) +return result; result =phm_find_boot_level (&(data->dpm_table.mclk_table), data->vbios_boot_state.mclk_bootup_value, (uint32_t *)&(table->MemoryBootLevel)); +if (result) +return result; + table->BootVddc = data->vbios_boot_state.vddc_bootup_value *VOLTAGE_SCALE ; table->BootVddci = data->vbios_boot_state.vddci_bootup_value *
Signature · 1 line
2.7.4
RE: [PATCH v2] drm/amd/powerplay: return errno code to caller when error occur
Quoted 45 lines
-----Original Message-----
From: Chen Wandun <[email protected]>
Sent: Monday, November 18, 2019 4:04 PM
To: Quan, Evan <[email protected]>; Deucher, Alexander <[email protected]>; [email protected]; linux- [email protected]; [email protected]
Cc: [email protected]
Subject: [PATCH v2] drm/amd/powerplay: return errno code to caller when error occurreturn errno code to caller when error occur, and meanwhile remove gcc '- Wunused-but-set-variable' warning.
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vegam_smumgr.c: In functionvegam_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 <[email protected]>--- drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c +5
-0@@ -1371,11 +1371,16 @@ static int vegam_populate_smc_boot_level(structpp_hwmgr *hwmgr, result =phm_find_boot_level (&(data->dpm_table.sclk_table), data->vbios_boot_state.sclk_bootup_value, (uint32_t *)&(table->GraphicsBootLevel)); +if (result) +return result; result =phm_find_boot_level (&(data->dpm_table.mclk_table), data->vbios_boot_state.mclk_bootup_value, (uint32_t *)&(table->MemoryBootLevel)); +if (result) +return result; + table->BootVddc = data->vbios_boot_state.vddc_bootup_value *VOLTAGE_SCALE ;
Quoted 3 lines
table->BootVddci=data->vbios_boot_state.vddci_bootup_value*
--
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Alex Deucher
AppliedRe: [PATCH v2] drm/amd/powerplay: return errno code to caller when error occur
Applied. Thanks!
Alex
Quoted 56 lines · Evan
Reviewed-by Evan Quan <[email protected]>Quoted 46 lines
-----Original Message-----
From: Chen Wandun <[email protected]>
Sent: Monday, November 18, 2019 4:04 PM
To: Quan, Evan <[email protected]>; Deucher, Alexander <[email protected]>; [email protected]; linux- [email protected]; [email protected]
Cc: [email protected]
Subject: [PATCH v2] drm/amd/powerplay: return errno code to caller when error occurreturn errno code to caller when error occur, and meanwhile remove gcc '- Wunused-but-set-variable' warning.
drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vegam_smumgr.c: In functionvegam_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 <[email protected]>--- drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c +5
-0@@ -1371,11 +1371,16 @@ static int vegam_populate_smc_boot_level(structpp_hwmgr *hwmgr, result =phm_find_boot_level (&(data->dpm_table.sclk_table), data->vbios_boot_state.sclk_bootup_value, (uint32_t *)&(table->GraphicsBootLevel)); +if (result) +return result; result =phm_find_boot_level (&(data->dpm_table.mclk_table), data->vbios_boot_state.mclk_bootup_value, (uint32_t *)&(table->MemoryBootLevel)); +if (result) +return result; + table->BootVddc = data->vbios_boot_state.vddc_bootup_value *VOLTAGE_SCALE ;table->BootVddci = data->vbios_boot_state.vddci_bootup_value *Quoted 2 lines
--
2.7.4_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx