[radeon-alex:drm-next-4.19-wip 47/115] drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:3769:5: warning: 'result' may be used uninitialized in this function

kbuild test robot lkp at intel.com
Thu Jun 14 03:32:51 UTC 2018


tree:   git://people.freedesktop.org/~agd5f/linux.git drm-next-4.19-wip
head:   69c20a808c86d7fd6cd64a9c8cc6b024a88c45fa
commit: fcad2435f489c3510cc95f6a38ff7db2f6292b6f [47/115] drm/amd/powerplay: Set higher SCLK&MCLK frequency than dpm7 in OD
config: x86_64-randconfig-s2-06141023 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
reproduce:
        git checkout fcad2435f489c3510cc95f6a38ff7db2f6292b6f
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c: In function 'smu7_set_power_state_tasks':
>> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:3769:5: warning: 'result' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (result)
        ^
   drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:3758:6: note: 'result' was declared here
     int result;
         ^~~~~~

vim +/result +3769 drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c

599a7e9f Rex Zhu      2016-09-09  3754  
599a7e9f Rex Zhu      2016-09-09  3755  static int smu7_generate_dpm_level_enable_mask(
599a7e9f Rex Zhu      2016-09-09  3756  		struct pp_hwmgr *hwmgr, const void *input)
599a7e9f Rex Zhu      2016-09-09  3757  {
599a7e9f Rex Zhu      2016-09-09  3758  	int result;
599a7e9f Rex Zhu      2016-09-09  3759  	const struct phm_set_power_state_input *states =
599a7e9f Rex Zhu      2016-09-09  3760  			(const struct phm_set_power_state_input *)input;
599a7e9f Rex Zhu      2016-09-09  3761  	struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
599a7e9f Rex Zhu      2016-09-09  3762  	const struct smu7_power_state *smu7_ps =
599a7e9f Rex Zhu      2016-09-09  3763  			cast_const_phw_smu7_power_state(states->pnew_state);
599a7e9f Rex Zhu      2016-09-09  3764  
fcad2435 Kenneth Feng 2018-06-12  3765  	/*skip the trim if od is enabled*/
fcad2435 Kenneth Feng 2018-06-12  3766  	if (!hwmgr->od_enabled)
599a7e9f Rex Zhu      2016-09-09  3767  		result = smu7_trim_dpm_states(hwmgr, smu7_ps);
fcad2435 Kenneth Feng 2018-06-12  3768  
599a7e9f Rex Zhu      2016-09-09 @3769  	if (result)
599a7e9f Rex Zhu      2016-09-09  3770  		return result;
599a7e9f Rex Zhu      2016-09-09  3771  
599a7e9f Rex Zhu      2016-09-09  3772  	data->dpm_level_enable_mask.sclk_dpm_enable_mask =
599a7e9f Rex Zhu      2016-09-09  3773  			phm_get_dpm_level_enable_mask_value(&data->dpm_table.sclk_table);
599a7e9f Rex Zhu      2016-09-09  3774  	data->dpm_level_enable_mask.mclk_dpm_enable_mask =
599a7e9f Rex Zhu      2016-09-09  3775  			phm_get_dpm_level_enable_mask_value(&data->dpm_table.mclk_table);
599a7e9f Rex Zhu      2016-09-09  3776  	data->dpm_level_enable_mask.pcie_dpm_enable_mask =
599a7e9f Rex Zhu      2016-09-09  3777  			phm_get_dpm_level_enable_mask_value(&data->dpm_table.pcie_speed_table);
599a7e9f Rex Zhu      2016-09-09  3778  
599a7e9f Rex Zhu      2016-09-09  3779  	return 0;
599a7e9f Rex Zhu      2016-09-09  3780  }
599a7e9f Rex Zhu      2016-09-09  3781  

:::::: The code at line 3769 was first introduced by commit
:::::: 599a7e9fe1b683d04f889d68f866f5548b1e0239 drm/amd/powerplay: implement smu7 hwmgr to manager asics with smu ip version 7.

:::::: TO: Rex Zhu <Rex.Zhu at amd.com>
:::::: CC: Alex Deucher <alexander.deucher at amd.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 31861 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20180614/ffc6126a/attachment-0001.gz>


More information about the dri-devel mailing list