From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============1704509742886616266==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] coccinelle: misc: fix minmax.cocci warnings Date: Sat, 27 Mar 2021 02:37:23 +0800 Message-ID: <20210326183723.GA119019@be91e78f92f7> In-Reply-To: <202103270244.aaA7SalA-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============1704509742886616266== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org TO: Denis Efremov CC: Julia Lawall CC: Hideaki YOSHIFUJI CC: David Ahern CC: Jakub Kicinski CC: netdev(a)vger.kernel.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot net/ipv6/sit.c:328:19-20: 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: 8636e3295ce3 ("coccinelle: misc: add minmax script") CC: Denis Efremov Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git f= or-5.12 head: cefe72053fc708df551780b0a69daef68ac1c39a commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/3] coccinelle: misc: ad= d minmax script :::::: branch date: 2 days ago :::::: commit date: 6 days ago Please take the patch only if it's a positive warning. Thanks! sit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -325,7 +325,7 @@ static int ipip6_tunnel_get_prl(struct n = rcu_read_lock(); = - ca =3D t->prl_count < cmax ? t->prl_count : cmax; + ca =3D min(t->prl_count, cmax); = if (!kp) { /* We don't try hard to allocate much memory for --===============1704509742886616266==--