Linux Remote Processor Subsystem development
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Wendy Liang <wendy.liang@xilinx.com>,
	Michal Simek <monstr@monstr.eu>, Ohad Ben-Cohen <ohad@wizery.com>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
	kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH] remoteproc: fix minmax.cocci warnings
Date: Tue, 8 Feb 2022 21:41:39 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2202082139180.52266@hadrien> (raw)

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

The code seems more readable with min.

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>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>

---

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

 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-02-08 22:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 20:41 Julia Lawall [this message]
2022-02-10 17:58 ` [PATCH] remoteproc: fix minmax.cocci warnings Mathieu Poirier

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=alpine.DEB.2.22.394.2202082139180.52266@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=bjorn.andersson@linaro.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=monstr@monstr.eu \
    --cc=ohad@wizery.com \
    --cc=wendy.liang@xilinx.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox