All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix minmax.cocci warnings
  2022-05-07 21:36 [xilinx-xlnx:master 30/530] drivers/remoteproc/remoteproc_sysfs.c:244:17-19: WARNING opportunity for min() kernel test robot
@ 2022-05-07 21:29 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-05-07 21:29 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1391 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-arm-kernel(a)lists.infradead.org
CC: Michal Simek <monstr@monstr.eu>

From: kernel test robot <lkp@intel.com>

drivers/remoteproc/remoteproc_sysfs.c:244:17-19: WARNING opportunity for min()


 Check for opencoded min(), max() implementations.
 Generated patches sometimes require adding a cast to fix compile warning.
 Warnings/patches scope intentionally limited to a function body.

Generated by: scripts/coccinelle/misc/minmax.cocci

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://github.com/Xilinx/linux-xlnx master
head:   d7d99e0d1629b249f6b118eb6a8e492e4334b1ea
commit: 9b62852ec04b7d48971ce8016b13c27403929908 [30/530] Merge tag 'v5.15' into master
:::::: branch date: 3 days ago
:::::: commit date: 5 months ago

Please take the patch only if it's a positive warning. Thanks!

 drivers/remoteproc/remoteproc_sysfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/remoteproc/remoteproc_sysfs.c
+++ b/drivers/remoteproc/remoteproc_sysfs.c
@@ -241,7 +241,7 @@ static ssize_t kick_store(struct device
 	size_t cpy_len;
 
 	(void)attr;
-	cpy_len = count <= sizeof(id) ? count : sizeof(id);
+	cpy_len = min(count, sizeof(id));
 	memcpy((char *)(&id), buf, cpy_len);
 
 	if (rproc->ops->kick)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [xilinx-xlnx:master 30/530] drivers/remoteproc/remoteproc_sysfs.c:244:17-19: WARNING opportunity for min()
@ 2022-05-07 21:36 kernel test robot
  2022-05-07 21:29 ` [PATCH] fix minmax.cocci warnings kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2022-05-07 21:36 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 969 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-arm-kernel(a)lists.infradead.org
CC: Michal Simek <monstr@monstr.eu>

tree:   https://github.com/Xilinx/linux-xlnx master
head:   d7d99e0d1629b249f6b118eb6a8e492e4334b1ea
commit: 9b62852ec04b7d48971ce8016b13c27403929908 [30/530] Merge tag 'v5.15' into master
:::::: branch date: 3 days ago
:::::: commit date: 5 months ago
config: x86_64-randconfig-c002 (https://download.01.org/0day-ci/archive/20220508/202205080552.Hfeod1Th-lkp(a)intel.com/config)
compiler: gcc-11 (Debian 11.2.0-20) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


cocci warnings: (new ones prefixed by >>)
>> drivers/remoteproc/remoteproc_sysfs.c:244:17-19: WARNING opportunity for min()

Please review and possibly fold the followup patch.

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-07 21:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-07 21:36 [xilinx-xlnx:master 30/530] drivers/remoteproc/remoteproc_sysfs.c:244:17-19: WARNING opportunity for min() kernel test robot
2022-05-07 21:29 ` [PATCH] fix minmax.cocci warnings 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.