lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202507150618.WOfvWsQF-lkp@intel.com>
Date: Tue, 15 Jul 2025 06:48:59 +0800
From: kernel test robot <lkp@...el.com>
To: Asad Kamal <asad.kamal@....com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	Alex Deucher <alexander.deucher@....com>,
	Lijo Lazar <lijo.lazar@....com>,
	Hawking Zhang <Hawking.Zhang@....com>
Subject: drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_12_ppt.c:273:5-8:
 Unneeded variable: "ret". Return "0" on line 329

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@...el.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ