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

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

CC: kbuild-all(a)lists.01.org
CC: linux-arm-kernel(a)lists.infradead.org
TO: Wendy Liang <wendy.liang@xilinx.com>
CC: Michal Simek <monstr@monstr.eu>
CC: "Ohad Ben-Cohen" <ohad@wizery.com>
CC: Bjorn Andersson <bjorn.andersson@linaro.org>
CC: Mathieu Poirier <mathieu.poirier@linaro.org>
CC: linux-remoteproc(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

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

Fixes: 2b9408d09dc6 ("remoteproc: Add support for peek from remote and acking kick from remote")
CC: Wendy Liang <wendy.liang@xilinx.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15
head:   1183ce490adb103e5e569b8ebd74c50c885ddc05
commit: 2b9408d09dc6367fd2f0820f0c7beab69e9aed56 [550/872] remoteproc: Add support for peek from remote and acking kick from remote
:::::: branch date: 7 days ago
:::::: commit date: 7 days ago

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

 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:xlnx_rebase_v5.15 550/872] drivers/remoteproc/remoteproc_sysfs.c:244:17-19: WARNING opportunity for min()
@ 2022-02-08 17:11 kernel test robot
  2022-02-08 17:05 ` [PATCH] remoteproc: fix minmax.cocci warnings kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2022-02-08 17:11 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
CC: linux-arm-kernel(a)lists.infradead.org
TO: Wendy Liang <wendy.liang@xilinx.com>
CC: Michal Simek <monstr@monstr.eu>

tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15
head:   1183ce490adb103e5e569b8ebd74c50c885ddc05
commit: 2b9408d09dc6367fd2f0820f0c7beab69e9aed56 [550/872] remoteproc: Add support for peek from remote and acking kick from remote
:::::: branch date: 7 days ago
:::::: commit date: 7 days ago
config: x86_64-randconfig-c022 (https://download.01.org/0day-ci/archive/20220209/202202090148.vR3UdeMM-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.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, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

end of thread, other threads:[~2022-02-08 17:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-08 17:11 [xilinx-xlnx:xlnx_rebase_v5.15 550/872] drivers/remoteproc/remoteproc_sysfs.c:244:17-19: WARNING opportunity for min() kernel test robot
2022-02-08 17:05 ` [PATCH] remoteproc: 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.