From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [PATCH] remoteproc: fix minmax.cocci warnings
Date: Sat, 26 Mar 2022 08:41:56 +0800 [thread overview]
Message-ID: <20220326004155.GA69728@c89866ef64da> (raw)
In-Reply-To: <202203260836.0xy9451H-lkp@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1850 bytes --]
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
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_LTS
head: 1870e0fa79a9d58c6748c34550f3ccea0b515933
commit: 2b9408d09dc6367fd2f0820f0c7beab69e9aed56 [550/1029] remoteproc: Add support for peek from remote and acking kick from remote
:::::: branch date: 35 hours ago
:::::: commit date: 8 weeks 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)
next prev parent reply other threads:[~2022-03-26 0:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-26 0:47 [xilinx-xlnx:xlnx_rebase_v5.15_LTS 550/1029] drivers/remoteproc/remoteproc_sysfs.c:244:17-19: WARNING opportunity for min() kernel test robot
2022-03-26 0:41 ` kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-06-19 13:34 [xilinx-xlnx:xlnx_rebase_v5.15_LTS 550/1181] " kernel test robot
2022-06-19 13:31 ` [PATCH] remoteproc: fix minmax.cocci warnings kernel test robot
2022-02-08 20:41 Julia Lawall
2022-02-08 20:41 ` Julia Lawall
2022-02-08 20:41 ` Julia Lawall
2022-02-10 17:58 ` Mathieu Poirier
2022-02-10 17:58 ` Mathieu Poirier
2022-02-10 17:58 ` Mathieu Poirier
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
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=20220326004155.GA69728@c89866ef64da \
--to=lkp@intel.com \
--cc=kbuild@lists.01.org \
/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.