From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============0496759781695815088==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] remoteproc: fix minmax.cocci warnings Date: Sat, 26 Mar 2022 08:41:56 +0800 Message-ID: <20220326004155.GA69728@c89866ef64da> In-Reply-To: <202203260836.0xy9451H-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============0496759781695815088== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org BCC: lkp(a)intel.com CC: linux-arm-kernel(a)lists.infradead.org TO: Wendy Liang CC: Michal Simek CC: "Ohad Ben-Cohen" CC: Bjorn Andersson CC: Mathieu Poirier CC: linux-remoteproc(a)vger.kernel.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot drivers/remoteproc/remoteproc_sysfs.c:244:17-19: WARNING opportunity for mi= n() 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 acki= ng kick from remote") CC: Wendy Liang Reported-by: kernel test robot Signed-off-by: kernel test robot --- 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 =3D count <=3D sizeof(id) ? count : sizeof(id); + cpy_len =3D min(count, sizeof(id)); memcpy((char *)(&id), buf, cpy_len); = if (rproc->ops->kick) --===============0496759781695815088==--