mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c:273:5-8: Unneeded variable: "ret". Return "0" on line 329
@ 2025-07-14 22:48 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-07-14 22:48 UTC (permalink / raw)
  To: Asad Kamal
  Cc: oe-kbuild-all, linux-kernel, Alex Deucher, Lijo Lazar, Hawking Zhang

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   347e9f5043c89695b01e66b3ed111755afcf1911
commit: 0b4119d54b17618c2ddb04a2af5bf5ebe24121e3 drm/amd/pm: Use separate metrics table for smu_v13_0_12
date:   5 months ago
config: arm-randconfig-r064-20250714 (https://download.01.org/0day-ci/archive/20250715/202507150618.WOfvWsQF-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 01c97b4953e87ae455bd4c41e3de3f0f0f29c61c)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507150618.WOfvWsQF-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c:273:5-8: Unneeded variable: "ret". Return "0" on line 329

vim +273 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c

   265	
   266	int smu_v13_0_12_get_smu_metrics_data(struct smu_context *smu,
   267					      MetricsMember_t member,
   268					      uint32_t *value)
   269	{
   270		struct smu_table_context *smu_table = &smu->smu_table;
   271		MetricsTable_t *metrics = (MetricsTable_t *)smu_table->metrics_table;
   272		struct amdgpu_device *adev = smu->adev;
 > 273		int ret = 0;
   274		int xcc_id;
   275	
   276		/* For clocks with multiple instances, only report the first one */
   277		switch (member) {
   278		case METRICS_CURR_GFXCLK:
   279		case METRICS_AVERAGE_GFXCLK:
   280			xcc_id = GET_INST(GC, 0);
   281			*value = SMUQ10_ROUND(metrics->GfxclkFrequency[xcc_id]);
   282			break;
   283		case METRICS_CURR_SOCCLK:
   284		case METRICS_AVERAGE_SOCCLK:
   285			*value = SMUQ10_ROUND(metrics->SocclkFrequency[0]);
   286			break;
   287		case METRICS_CURR_UCLK:
   288		case METRICS_AVERAGE_UCLK:
   289			*value = SMUQ10_ROUND(metrics->UclkFrequency);
   290			break;
   291		case METRICS_CURR_VCLK:
   292			*value = SMUQ10_ROUND(metrics->VclkFrequency[0]);
   293			break;
   294		case METRICS_CURR_DCLK:
   295			*value = SMUQ10_ROUND(metrics->DclkFrequency[0]);
   296			break;
   297		case METRICS_CURR_FCLK:
   298			*value = SMUQ10_ROUND(metrics->FclkFrequency);
   299			break;
   300		case METRICS_AVERAGE_GFXACTIVITY:
   301			*value = SMUQ10_ROUND(metrics->SocketGfxBusy);
   302			break;
   303		case METRICS_AVERAGE_MEMACTIVITY:
   304			*value = SMUQ10_ROUND(metrics->DramBandwidthUtilization);
   305			break;
   306		case METRICS_CURR_SOCKETPOWER:
   307			*value = SMUQ10_ROUND(metrics->SocketPower) << 8;
   308			break;
   309		case METRICS_TEMPERATURE_HOTSPOT:
   310			*value = SMUQ10_ROUND(metrics->MaxSocketTemperature) *
   311				 SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
   312			break;
   313		case METRICS_TEMPERATURE_MEM:
   314			*value = SMUQ10_ROUND(metrics->MaxHbmTemperature) *
   315				 SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
   316			break;
   317		/* This is the max of all VRs and not just SOC VR.
   318		 * No need to define another data type for the same.
   319		 */
   320		case METRICS_TEMPERATURE_VRSOC:
   321			*value = SMUQ10_ROUND(metrics->MaxVrTemperature) *
   322				 SMU_TEMPERATURE_UNITS_PER_CENTIGRADES;
   323			break;
   324		default:
   325			*value = UINT_MAX;
   326			break;
   327		}
   328	
 > 329		return ret;
   330	}
   331	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-07-14 22:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-14 22:48 drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c:273:5-8: Unneeded variable: "ret". Return "0" on line 329 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®