Commit 3678a9d8 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

netlink: cleanup rntl_af_register

The function __rtnl_af_register is never called outside this
code, and the return value is always 0.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 47d1f71f
...@@ -115,10 +115,9 @@ struct rtnl_af_ops { ...@@ -115,10 +115,9 @@ struct rtnl_af_ops {
const struct nlattr *attr); const struct nlattr *attr);
}; };
int __rtnl_af_register(struct rtnl_af_ops *ops);
void __rtnl_af_unregister(struct rtnl_af_ops *ops); void __rtnl_af_unregister(struct rtnl_af_ops *ops);
int rtnl_af_register(struct rtnl_af_ops *ops); void rtnl_af_register(struct rtnl_af_ops *ops);
void rtnl_af_unregister(struct rtnl_af_ops *ops); void rtnl_af_unregister(struct rtnl_af_ops *ops);
struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]);
......
...@@ -481,9 +481,7 @@ int __init br_netlink_init(void) ...@@ -481,9 +481,7 @@ int __init br_netlink_init(void)
int err; int err;
br_mdb_init(); br_mdb_init();
err = rtnl_af_register(&br_af_ops); rtnl_af_register(&br_af_ops);
if (err)
goto out;
err = rtnl_link_register(&br_link_ops); err = rtnl_link_register(&br_link_ops);
if (err) if (err)
...@@ -493,7 +491,6 @@ int __init br_netlink_init(void) ...@@ -493,7 +491,6 @@ int __init br_netlink_init(void)
out_af: out_af:
rtnl_af_unregister(&br_af_ops); rtnl_af_unregister(&br_af_ops);
out:
br_mdb_uninit(); br_mdb_uninit();
return err; return err;
} }
......
...@@ -402,35 +402,17 @@ static const struct rtnl_af_ops *rtnl_af_lookup(const int family) ...@@ -402,35 +402,17 @@ static const struct rtnl_af_ops *rtnl_af_lookup(const int family)
return NULL; return NULL;
} }
/**
* __rtnl_af_register - Register rtnl_af_ops with rtnetlink.
* @ops: struct rtnl_af_ops * to register
*
* The caller must hold the rtnl_mutex.
*
* Returns 0 on success or a negative error code.
*/
int __rtnl_af_register(struct rtnl_af_ops *ops)
{
list_add_tail(&ops->list, &rtnl_af_ops);
return 0;
}
EXPORT_SYMBOL_GPL(__rtnl_af_register);
/** /**
* rtnl_af_register - Register rtnl_af_ops with rtnetlink. * rtnl_af_register - Register rtnl_af_ops with rtnetlink.
* @ops: struct rtnl_af_ops * to register * @ops: struct rtnl_af_ops * to register
* *
* Returns 0 on success or a negative error code. * Returns 0 on success or a negative error code.
*/ */
int rtnl_af_register(struct rtnl_af_ops *ops) void rtnl_af_register(struct rtnl_af_ops *ops)
{ {
int err;
rtnl_lock(); rtnl_lock();
err = __rtnl_af_register(ops); list_add_tail(&ops->list, &rtnl_af_ops);
rtnl_unlock(); rtnl_unlock();
return err;
} }
EXPORT_SYMBOL_GPL(rtnl_af_register); EXPORT_SYMBOL_GPL(rtnl_af_register);
......
...@@ -5207,9 +5207,7 @@ int __init addrconf_init(void) ...@@ -5207,9 +5207,7 @@ int __init addrconf_init(void)
addrconf_verify(0); addrconf_verify(0);
err = rtnl_af_register(&inet6_ops); rtnl_af_register(&inet6_ops);
if (err < 0)
goto errout_af;
err = __rtnl_register(PF_INET6, RTM_GETLINK, NULL, inet6_dump_ifinfo, err = __rtnl_register(PF_INET6, RTM_GETLINK, NULL, inet6_dump_ifinfo,
NULL); NULL);
...@@ -5233,7 +5231,6 @@ int __init addrconf_init(void) ...@@ -5233,7 +5231,6 @@ int __init addrconf_init(void)
return 0; return 0;
errout: errout:
rtnl_af_unregister(&inet6_ops); rtnl_af_unregister(&inet6_ops);
errout_af:
unregister_netdevice_notifier(&ipv6_dev_notf); unregister_netdevice_notifier(&ipv6_dev_notf);
errlo: errlo:
unregister_pernet_subsys(&addrconf_ops); unregister_pernet_subsys(&addrconf_ops);
......
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