* drivers/gpu/drm/amd/ras/rascore/ras_umc.c:267:21-22: WARNING opportunity for min()
@ 2026-06-27 14:02 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-06-27 14:02 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Julia Lawall
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: YiPeng Chai <YiPeng.Chai@amd.com>
CC: Alex Deucher <alexander.deucher@amd.com>
CC: Tao Zhou <tao.zhou1@amd.com>
CC: Hawking Zhang <Hawking.Zhang@amd.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5a66900afbd6b2a063eebad35294038a654de2b0
commit: ace232eff50e8c898103c56b3b5303e776616274 drm/amdgpu: Add ras module files into amdgpu
date: 9 months ago
:::::: branch date: 14 hours ago
:::::: commit date: 9 months ago
config: i386-randconfig-r064-20260627 (https://download.01.org/0day-ci/archive/20260627/202606272131.dOwEeYSu-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
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
| Fixes: ace232eff50e ("drm/amdgpu: Add ras module files into amdgpu")
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202606272131.dOwEeYSu-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/amd/ras/rascore/ras_umc.c:267:21-22: WARNING opportunity for min()
--
>> drivers/gpu/drm/amd/ras/rascore/ras_eeprom.c:229:4-8: opportunity for str_read_write(read)
vim +267 drivers/gpu/drm/amd/ras/rascore/ras_umc.c
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 261
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 262 static int ras_umc_get_new_records(struct ras_core_context *ras_core,
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 263 struct eeprom_umc_record *records, u32 num)
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 264 {
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 265 struct ras_umc *ras_umc = &ras_core->ras_umc;
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 266 struct eeprom_umc_record *entries[MAX_ECC_NUM_PER_RETIREMENT];
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 @267 u32 entry_num = num < MAX_ECC_NUM_PER_RETIREMENT ? num : MAX_ECC_NUM_PER_RETIREMENT;
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 268 int count = 0;
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 269 int new_detected, i;
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 270
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 271 mutex_lock(&ras_umc->tree_lock);
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 272 new_detected = radix_tree_gang_lookup_tag(&ras_umc->root, (void **)entries,
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 273 0, entry_num, UMC_ECC_NEW_DETECTED_TAG);
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 274 for (i = 0; i < new_detected; i++) {
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 275 if (!entries[i])
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 276 continue;
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 277
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 278 memcpy(&records[i], entries[i], sizeof(struct eeprom_umc_record));
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 279 count++;
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 280 radix_tree_tag_clear(&ras_umc->root,
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 281 entries[i]->cur_nps_retired_row_pfn, UMC_ECC_NEW_DETECTED_TAG);
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 282 }
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 283 mutex_unlock(&ras_umc->tree_lock);
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 284
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 285 return count;
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 286 }
7a3f9c0992c4f8 YiPeng Chai 2025-03-17 287
:::::: The code at line 267 was first introduced by commit
:::::: 7a3f9c0992c4f8e3d9c0c340ec46e4a8ebd1c7d5 drm/amd/ras: Add umc common ras functions
:::::: TO: YiPeng Chai <YiPeng.Chai@amd.com>
:::::: CC: Alex Deucher <alexander.deucher@amd.com>
--
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:[~2026-06-27 14:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-27 14:02 drivers/gpu/drm/amd/ras/rascore/ras_umc.c:267:21-22: WARNING opportunity for min() kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.