2021-03-27 09:31:15

by Julia Lawall

[permalink] [raw]
Subject: [PATCH] sit: use min

From: kernel test robot <[email protected]>

Opportunity for min()

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

CC: Denis Efremov <[email protected]>
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

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


2021-03-27 19:16:17

by David Ahern

[permalink] [raw]
Subject: Re: [PATCH] sit: use min

On 3/27/21 3:29 AM, Julia Lawall wrote:
> From: kernel test robot <[email protected]>
>
> Opportunity for min()
>
> Generated by: scripts/coccinelle/misc/minmax.cocci
>
> CC: Denis Efremov <[email protected]>
> Reported-by: kernel test robot <[email protected]>
> Signed-off-by: kernel test robot <[email protected]>
> ---
>
> sit.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: David Ahern <[email protected]>