diff mbox series

sit: use min

Message ID alpine.DEB.2.22.394.2103271024110.2888@hadrien (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series sit: use min | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Julia Lawall March 27, 2021, 9:29 a.m. UTC
From: kernel test robot <lkp@intel.com>

Opportunity for min()

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

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

 sit.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Ahern March 27, 2021, 7:14 p.m. UTC | #1
On 3/27/21 3:29 AM, Julia Lawall wrote:
> From: kernel test robot <lkp@intel.com>
> 
> Opportunity for min()
> 
> Generated by: scripts/coccinelle/misc/minmax.cocci
> 
> CC: Denis Efremov <efremov@linux.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> ---
> 
>  sit.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: David Ahern <dsahern@kernel.org>
diff mbox series

Patch

--- 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