diff options
author | Zhengchao Shao <shaozhengchao@huawei.com> | 2022-11-04 10:25:13 +0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-11-04 19:28:06 -0700 |
commit | 552acbf576fb7cb7ec70e978ca148dfbdae12a0e (patch) | |
tree | 2f873637d97eebb01f71c3461f294562209e870a /net/ipv4 | |
parent | 95ec6bce2a0bb7ec9c76fe5c2a9db3b9e62c950d (diff) | |
download | linux-552acbf576fb7cb7ec70e978ca148dfbdae12a0e.tar.gz linux-552acbf576fb7cb7ec70e978ca148dfbdae12a0e.tar.bz2 linux-552acbf576fb7cb7ec70e978ca148dfbdae12a0e.zip |
net: remove redundant check in ip_metrics_convert()
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>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20221104022513.168868-1-shaozhengchao@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/metrics.c | 3 |
1 files changed, 0 insertions, 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; |