Skip to contentSkip to conversation

sit: use min

PATCH In review Julia Lawall 2 participants 2 messages Mar 27, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sit: use min

From: kernel test robot <[email protected]>

Opportunity for min()

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

---

 sit.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/sit.c +1 -1
@@ -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