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 for-5.12 head: cefe72053fc708df551780b0a69daef68ac1c39a commit: 8636e3295ce33515c50ef728f0ff3800d97f9f44 [1/3] coccinelle: misc: add 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 = t->prl_count < cmax ? t->prl_count : cmax; + ca = min(t->prl_count, cmax); if (!kp) { /* We don't try hard to allocate much memory for