From: kernel test robot <lkp@intel.com>
To: Asad Kamal <asad.kamal@amd.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Alex Deucher <alexander.deucher@amd.com>,
Lijo Lazar <lijo.lazar@amd.com>,
Hawking Zhang <Hawking.Zhang@amd.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
Date: Tue, 15 Jul 2025 06:48:59 +0800 [thread overview]
Message-ID: <202507150618.WOfvWsQF-lkp@intel.com> (raw)
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
reply other threads:[~2025-07-14 22:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202507150618.WOfvWsQF-lkp@intel.com \
--to=lkp@intel.com \
--cc=Hawking.Zhang@amd.com \
--cc=alexander.deucher@amd.com \
--cc=asad.kamal@amd.com \
--cc=lijo.lazar@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®