Thread (2 messages) flat view 2 messages, 2 authors, 2021-03-27
STALE1957d

[PATCH] sit: use min

From: Julia Lawall <julia.lawall@inria.fr>
Date: 2021-03-27 09:30:27
Also in: lkml, oe-kbuild-all

From: kernel test robot <redacted>

Opportunity for min()

Generated by: scripts/coccinelle/misc/minmax.cocci

CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <redacted>
Signed-off-by: kernel test robot <redacted>
---

 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help