From: alex.bluesman.smirnov@gmail.com
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Subject: [PATCH] rtnetlink: rtnl_link_register always returns zero
Date: Wed, 14 Dec 2011 00:31:21 +0400 [thread overview]
Message-ID: <1323808281-9967-1-git-send-email-alex.bluesman.smirnov@gmail.com> (raw)
From: Alexander Smirnov <alexander@Lenovo.(none)>
Both functions 'rtnl_link_register' and '__rtnl_link_register' always
return zero. So handling return status has no sense in several drivers.
Signed-off-by: Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
---
drivers/net/bonding/bond_main.c | 6 +-----
drivers/net/can/dev.c | 8 +-------
drivers/net/tun.c | 8 ++------
3 files changed, 4 insertions(+), 18 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 25a44d9..f79bb97 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4921,9 +4921,7 @@ static int __init bonding_init(void)
if (res)
goto out;
- res = rtnl_link_register(&bond_link_ops);
- if (res)
- goto err_link;
+ rtnl_link_register(&bond_link_ops);
bond_create_debugfs();
@@ -4939,10 +4937,8 @@ out:
return res;
err:
rtnl_link_unregister(&bond_link_ops);
-err_link:
unregister_pernet_subsys(&bond_net_ops);
goto out;
-
}
static void __exit bonding_exit(void)
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index 120f1ab..e5b5daf 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -756,13 +756,7 @@ EXPORT_SYMBOL_GPL(unregister_candev);
static __init int can_dev_init(void)
{
- int err;
-
- err = rtnl_link_register(&can_link_ops);
- if (!err)
- printk(KERN_INFO MOD_DESC "\n");
-
- return err;
+ return rtnl_link_register(&can_link_ops);
}
module_init(can_dev_init);
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 93c5d72..bb034b1 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1632,16 +1632,12 @@ static const struct ethtool_ops tun_ethtool_ops = {
static int __init tun_init(void)
{
- int ret = 0;
+ int ret;
pr_info("%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
pr_info("%s\n", DRV_COPYRIGHT);
- ret = rtnl_link_register(&tun_link_ops);
- if (ret) {
- pr_err("Can't register link_ops\n");
- goto err_linkops;
- }
+ rtnl_link_register(&tun_link_ops);
ret = misc_register(&tun_miscdev);
if (ret) {
--
1.7.0.4
next reply other threads:[~2011-12-13 20:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-13 20:31 alex.bluesman.smirnov [this message]
2011-12-13 21:08 ` [PATCH] rtnetlink: rtnl_link_register always returns zero David Miller
2011-12-13 21:38 ` [PATCH net-next] rtnetlink: rtnl_link_register() sanity test Eric Dumazet
2011-12-14 7:47 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1323808281-9967-1-git-send-email-alex.bluesman.smirnov@gmail.com \
--to=alex.bluesman.smirnov@gmail.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).