All of lore.kernel.org
 help / color / mirror / Atom feed
* [avpatel:riscv_mpxy_imp_v1 2/5] arch/riscv/kernel/sbi_mpxy.c:104:19-20: WARNING opportunity for min()
@ 2026-09-30 17:48 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-30 17:48 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Anup Patel <anup.patel@oss.qualcomm.com>
CC: Himanshu Chauhan <himanshu.chauhan@oss.qualcomm.com>

tree:   https://github.com/avpatel/linux.git riscv_mpxy_imp_v1
head:   48be05a1fcc231a756503546729aefd39ba8ca76
commit: 6439174960c8ce56a3b4ce6eb5fabde7bdaae27a [2/5] RISC-V: Move common MPXY helper routines to arch/riscv
:::::: branch date: 9 hours ago
:::::: commit date: 9 hours ago
config: riscv-randconfig-r2103-20260930 (https://download.01.org/0day-ci/archive/20260930/202609301955.YFKKcuVe-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)

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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202609301955.YFKKcuVe-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> arch/riscv/kernel/sbi_mpxy.c:104:19-20: WARNING opportunity for min()

vim +104 arch/riscv/kernel/sbi_mpxy.c

6439174960c8ce Anup Patel 2026-05-26   80  
6439174960c8ce Anup Patel 2026-05-26   81  int sbi_mpxy_get_channel_ids(u32 channel_count, u32 *channel_ids)
6439174960c8ce Anup Patel 2026-05-26   82  {
6439174960c8ce Anup Patel 2026-05-26   83  	struct mpxy_local *mpxy = this_cpu_ptr(&mpxy_local);
6439174960c8ce Anup Patel 2026-05-26   84  	struct sbi_mpxy_channel_ids_data *sdata = mpxy->shmem;
6439174960c8ce Anup Patel 2026-05-26   85  	u32 remaining, returned, count, start_index = 0;
6439174960c8ce Anup Patel 2026-05-26   86  	struct sbiret sret;
6439174960c8ce Anup Patel 2026-05-26   87  
6439174960c8ce Anup Patel 2026-05-26   88  	if (!mpxy->shmem_active)
6439174960c8ce Anup Patel 2026-05-26   89  		return -ENODEV;
6439174960c8ce Anup Patel 2026-05-26   90  	if (!channel_count || !channel_ids)
6439174960c8ce Anup Patel 2026-05-26   91  		return -EINVAL;
6439174960c8ce Anup Patel 2026-05-26   92  
6439174960c8ce Anup Patel 2026-05-26   93  	get_cpu();
6439174960c8ce Anup Patel 2026-05-26   94  
6439174960c8ce Anup Patel 2026-05-26   95  	do {
6439174960c8ce Anup Patel 2026-05-26   96  		sret = sbi_ecall(SBI_EXT_MPXY, SBI_EXT_MPXY_GET_CHANNEL_IDS,
6439174960c8ce Anup Patel 2026-05-26   97  				 start_index, 0, 0, 0, 0, 0);
6439174960c8ce Anup Patel 2026-05-26   98  		if (sret.error)
6439174960c8ce Anup Patel 2026-05-26   99  			goto err_put_cpu;
6439174960c8ce Anup Patel 2026-05-26  100  
6439174960c8ce Anup Patel 2026-05-26  101  		remaining = le32_to_cpu(sdata->remaining);
6439174960c8ce Anup Patel 2026-05-26  102  		returned = le32_to_cpu(sdata->returned);
6439174960c8ce Anup Patel 2026-05-26  103  
6439174960c8ce Anup Patel 2026-05-26 @104  		count = returned < (channel_count - start_index) ?
6439174960c8ce Anup Patel 2026-05-26  105  			returned : (channel_count - start_index);
6439174960c8ce Anup Patel 2026-05-26  106  		memcpy_from_le32(&channel_ids[start_index], sdata->channel_array, count);
6439174960c8ce Anup Patel 2026-05-26  107  		start_index += count;
6439174960c8ce Anup Patel 2026-05-26  108  	} while (remaining && start_index < channel_count);
6439174960c8ce Anup Patel 2026-05-26  109  
6439174960c8ce Anup Patel 2026-05-26  110  err_put_cpu:
6439174960c8ce Anup Patel 2026-05-26  111  	put_cpu();
6439174960c8ce Anup Patel 2026-05-26  112  	return sbi_err_map_linux_errno(sret.error);
6439174960c8ce Anup Patel 2026-05-26  113  }
6439174960c8ce Anup Patel 2026-05-26  114  EXPORT_SYMBOL_GPL(sbi_mpxy_get_channel_ids);
6439174960c8ce Anup Patel 2026-05-26  115  

--
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-09-30 17:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-30 17:48 [avpatel:riscv_mpxy_imp_v1 2/5] arch/riscv/kernel/sbi_mpxy.c:104:19-20: 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.