All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Julia Lawall <julia.lawall@inria.fr>
Subject: drivers/gpu/drm/amd/ras/rascore/ras_umc.c:267:21-22: WARNING opportunity for min()
Date: Sat, 27 Jun 2026 22:02:59 +0800	[thread overview]
Message-ID: <202606272131.dOwEeYSu-lkp@intel.com> (raw)

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

                 reply	other threads:[~2026-06-27 14:04 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=202606272131.dOwEeYSu-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=julia.lawall@inria.fr \
    --cc=oe-kbuild@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 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.