Content-Type: multipart/mixed; boundary="===============8417961596050096618==" MIME-Version: 1.0 From: Mathieu Poirier To: kbuild-all@lists.01.org Subject: Re: [PATCH] remoteproc: fix minmax.cocci warnings Date: Thu, 10 Feb 2022 10:58:47 -0700 Message-ID: <20220210175847.GA3603040@p14s> In-Reply-To: List-Id: --===============8417961596050096618== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi, On Tue, Feb 08, 2022 at 09:41:39PM +0100, Julia Lawall wrote: > From: kernel test robot > = > The code seems more readable with min. > = > Generated by: scripts/coccinelle/misc/minmax.cocci > = > Fixes: 2b9408d09dc6 ("remoteproc: Add support for peek from remote and ac= king kick from remote") > CC: Wendy Liang > Reported-by: kernel test robot > Signed-off-by: kernel test robot > Signed-off-by: Julia Lawall > = > --- > = > tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15 > head: 1183ce490adb103e5e569b8ebd74c50c885ddc05 > commit: 2b9408d09dc6367fd2f0820f0c7beab69e9aed56 [550/872] remoteproc: Ad= d 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 =3D count <=3D sizeof(id) ? count : sizeof(id); > + cpy_len =3D min(count, sizeof(id)); Looking at the min() macro the above would become "count < sizeof(id)" rath= er than "count <=3D sizeof(id)". I don't have more context into this code bec= ause I can't find it in rproc-next nor today's linux-next, but it is something to = look into. The patch is also missing the minmax.h include for the min() macro. Thanks, Mathieu > memcpy((char *)(&id), buf, cpy_len); > = > if (rproc->ops->kick) --===============8417961596050096618==--