All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] nexthop: simplify code in nh_valid_get_bucket_req
@ 2022-09-17  6:30 williamsukatube
  2022-09-17 14:45 ` David Ahern
  2022-09-17 16:07 ` Christophe JAILLET
  0 siblings, 2 replies; 3+ messages in thread
From: williamsukatube @ 2022-09-17  6:30 UTC (permalink / raw)
  To: dsahern, davem, yoshfuji, edumazet, kuba, pabeni, netdev, linux-kernel
  Cc: William Dean

From: William Dean <williamsukatube@163.com>

It could directly return 'nh_valid_get_bucket_req_res_bucket' to simplify code.

Signed-off-by: William Dean <williamsukatube@163.com>
---
 net/ipv4/nexthop.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
index 853a75a8fbaf..1556961cf153 100644
--- a/net/ipv4/nexthop.c
+++ b/net/ipv4/nexthop.c
@@ -3489,12 +3489,8 @@ static int nh_valid_get_bucket_req(const struct nlmsghdr *nlh,
 		return -EINVAL;
 	}

-	err = nh_valid_get_bucket_req_res_bucket(tb[NHA_RES_BUCKET],
+	return nh_valid_get_bucket_req_res_bucket(tb[NHA_RES_BUCKET],
 						 bucket_index, extack);
-	if (err)
-		return err;
-
-	return 0;
 }

 /* rtnl */
--
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] nexthop: simplify code in nh_valid_get_bucket_req
  2022-09-17  6:30 [PATCH -next] nexthop: simplify code in nh_valid_get_bucket_req williamsukatube
@ 2022-09-17 14:45 ` David Ahern
  2022-09-17 16:07 ` Christophe JAILLET
  1 sibling, 0 replies; 3+ messages in thread
From: David Ahern @ 2022-09-17 14:45 UTC (permalink / raw)
  To: williamsukatube, davem, yoshfuji, edumazet, kuba, pabeni, netdev,
	linux-kernel

On 9/17/22 12:30 AM, williamsukatube@163.com wrote:
> From: William Dean <williamsukatube@163.com>
> 
> It could directly return 'nh_valid_get_bucket_req_res_bucket' to simplify code.
> 
> Signed-off-by: William Dean <williamsukatube@163.com>
> ---
>  net/ipv4/nexthop.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] nexthop: simplify code in nh_valid_get_bucket_req
  2022-09-17  6:30 [PATCH -next] nexthop: simplify code in nh_valid_get_bucket_req williamsukatube
  2022-09-17 14:45 ` David Ahern
@ 2022-09-17 16:07 ` Christophe JAILLET
  1 sibling, 0 replies; 3+ messages in thread
From: Christophe JAILLET @ 2022-09-17 16:07 UTC (permalink / raw)
  To: williamsukatube, dsahern, davem, yoshfuji, edumazet, kuba,
	pabeni, netdev, linux-kernel

Le 17/09/2022 à 08:30, williamsukatube@163.com a écrit :
> From: William Dean <williamsukatube@163.com>
> 
> It could directly return 'nh_valid_get_bucket_req_res_bucket' to simplify code.
> 
> Signed-off-by: William Dean <williamsukatube@163.com>
> ---
>   net/ipv4/nexthop.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
> index 853a75a8fbaf..1556961cf153 100644
> --- a/net/ipv4/nexthop.c
> +++ b/net/ipv4/nexthop.c
> @@ -3489,12 +3489,8 @@ static int nh_valid_get_bucket_req(const struct nlmsghdr *nlh,
>   		return -EINVAL;
>   	}
> 
> -	err = nh_valid_get_bucket_req_res_bucket(tb[NHA_RES_BUCKET],
> +	return nh_valid_get_bucket_req_res_bucket(tb[NHA_RES_BUCKET],
>   						 bucket_index, extack);

Nit: there should be 1 additional space to keep alignment.

CJ

> -	if (err)
> -		return err;
> -
> -	return 0;
>   }
> 
>   /* rtnl */



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-17 16:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-17  6:30 [PATCH -next] nexthop: simplify code in nh_valid_get_bucket_req williamsukatube
2022-09-17 14:45 ` David Ahern
2022-09-17 16:07 ` Christophe JAILLET

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.