Commit 552acbf5 authored by Zhengchao Shao's avatar Zhengchao Shao Committed by Jakub Kicinski

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: default avatarZhengchao Shao <shaozhengchao@huawei.com>
Reviewed-by: default avatarDavid Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20221104022513.168868-1-shaozhengchao@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 95ec6bce
...@@ -14,9 +14,6 @@ static int ip_metrics_convert(struct net *net, struct nlattr *fc_mx, ...@@ -14,9 +14,6 @@ static int ip_metrics_convert(struct net *net, struct nlattr *fc_mx,
struct nlattr *nla; struct nlattr *nla;
int remaining; int remaining;
if (!fc_mx)
return 0;
nla_for_each_attr(nla, fc_mx, fc_mx_len, remaining) { nla_for_each_attr(nla, fc_mx, fc_mx_len, remaining) {
int type = nla_type(nla); int type = nla_type(nla);
u32 val; u32 val;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment