All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: remove redundant check in ip_metrics_convert()
@ 2022-11-04  2:25 Zhengchao Shao
  2022-11-04  3:15 ` David Ahern
  2022-11-05  2:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Zhengchao Shao @ 2022-11-04  2:25 UTC (permalink / raw)
  To: netdev, davem, yoshfuji, dsahern, edumazet, kuba, pabeni
  Cc: weiyongjun1, yuehaibing, shaozhengchao

Now ip_metrics_convert() is only called by ip_fib_metrics_init(). Before
ip_fib_metrics_init() invokes ip_metrics_convert(), it checks whether
input parameter fc_mx is NULL. Therefore, ip_metrics_convert() doesn't
need to check fc_mx.

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
 net/ipv4/metrics.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/ipv4/metrics.c b/net/ipv4/metrics.c
index 25ea6ac44db9..7fcfdfd8f9de 100644
--- a/net/ipv4/metrics.c
+++ b/net/ipv4/metrics.c
@@ -14,9 +14,6 @@ static int ip_metrics_convert(struct net *net, struct nlattr *fc_mx,
 	struct nlattr *nla;
 	int remaining;
 
-	if (!fc_mx)
-		return 0;
-
 	nla_for_each_attr(nla, fc_mx, fc_mx_len, remaining) {
 		int type = nla_type(nla);
 		u32 val;
-- 
2.17.1


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

* Re: [PATCH net-next] net: remove redundant check in ip_metrics_convert()
  2022-11-04  2:25 [PATCH net-next] net: remove redundant check in ip_metrics_convert() Zhengchao Shao
@ 2022-11-04  3:15 ` David Ahern
  2022-11-05  2:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: David Ahern @ 2022-11-04  3:15 UTC (permalink / raw)
  To: Zhengchao Shao, netdev, davem, yoshfuji, edumazet, kuba, pabeni
  Cc: weiyongjun1, yuehaibing

On 11/3/22 8:25 PM, Zhengchao Shao wrote:
> Now ip_metrics_convert() is only called by ip_fib_metrics_init(). Before
> ip_fib_metrics_init() invokes ip_metrics_convert(), it checks whether
> input parameter fc_mx is NULL. Therefore, ip_metrics_convert() doesn't
> need to check fc_mx.
> 
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
> ---
>  net/ipv4/metrics.c | 3 ---
>  1 file changed, 3 deletions(-)
> 


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

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

* Re: [PATCH net-next] net: remove redundant check in ip_metrics_convert()
  2022-11-04  2:25 [PATCH net-next] net: remove redundant check in ip_metrics_convert() Zhengchao Shao
  2022-11-04  3:15 ` David Ahern
@ 2022-11-05  2:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-05  2:40 UTC (permalink / raw)
  To: Zhengchao Shao
  Cc: netdev, davem, yoshfuji, dsahern, edumazet, kuba, pabeni,
	weiyongjun1, yuehaibing

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 4 Nov 2022 10:25:13 +0800 you wrote:
> Now ip_metrics_convert() is only called by ip_fib_metrics_init(). Before
> ip_fib_metrics_init() invokes ip_metrics_convert(), it checks whether
> input parameter fc_mx is NULL. Therefore, ip_metrics_convert() doesn't
> need to check fc_mx.
> 
> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
> 
> [...]

Here is the summary with links:
  - [net-next] net: remove redundant check in ip_metrics_convert()
    https://git.kernel.org/netdev/net-next/c/552acbf576fb

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-11-05  2:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-04  2:25 [PATCH net-next] net: remove redundant check in ip_metrics_convert() Zhengchao Shao
2022-11-04  3:15 ` David Ahern
2022-11-05  2:40 ` patchwork-bot+netdevbpf

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.