All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [PATCH] fix minmax.cocci warnings
Date: Sun, 08 May 2022 05:29:55 +0800	[thread overview]
Message-ID: <Ynbk0zComJqmZ5Kl@610037dfa3f7> (raw)
In-Reply-To: <202205080552.Hfeod1Th-lkp@intel.com>

[-- 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)

      reply	other threads:[~2022-05-07 21:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

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=Ynbk0zComJqmZ5Kl@610037dfa3f7 \
    --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.