[bug report] drm/amd/pp: Implement edit_dpm_table on smu7

Dan Carpenter dan.carpenter at oracle.com
Fri Mar 2 10:16:20 UTC 2018


Hello Rex Zhu,

The patch 5e4d4fbea557: "drm/amd/pp: Implement edit_dpm_table on
smu7" from Jan 16, 2018, leads to the following static checker
warning:

	drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:4784 smu7_check_clk_voltage_valid()
	warn: signedness bug returning '(-22)'

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c
  4771  static bool smu7_check_clk_voltage_valid(struct pp_hwmgr *hwmgr,
               ^^^^

  4772                                          enum PP_OD_DPM_TABLE_COMMAND type,
  4773                                          uint32_t clk,
  4774                                          uint32_t voltage)
  4775  {
  4776          struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
  4777  
  4778          struct phm_ppt_v1_information *table_info =
  4779                          (struct phm_ppt_v1_information *)(hwmgr->pptable);
  4780          uint32_t min_vddc;
  4781          struct phm_ppt_v1_clock_voltage_dependency_table *dep_sclk_table;
  4782  
  4783          if (table_info == NULL)
  4784                  return -EINVAL;
                        ^^^^^^^^^^^^^^^
This means "return true;".  Can table_info really be NULL, anyway?

  4785  
  4786          dep_sclk_table = table_info->vdd_dep_on_sclk;
  4787          min_vddc = dep_sclk_table->entries[0].vddc;
  4788  

regards,
dan carpenter


More information about the amd-gfx mailing list