From: Ding Tianhong <dingtianhong@huawei.com>
To: Denis Kirjanov <kda@linux-powerpc.org>, <davem@davemloft.net>,
<netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] net: remove useless if check from register_netdevice()
Date: Wed, 12 Feb 2014 16:24:31 +0800 [thread overview]
Message-ID: <52FB2FBF.7050907@huawei.com> (raw)
In-Reply-To: <1392191152-24182-1-git-send-email-kda@linux-powerpc.org>
On 2014/2/12 15:45, Denis Kirjanov wrote:
> remove useless if check from register_netdevice()
>
> Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org>
> ---
> net/core/dev.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 4ad1b78..4be9a37 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -5876,8 +5876,7 @@ int register_netdevice(struct net_device *dev)
> if (dev->netdev_ops->ndo_init) {
> ret = dev->netdev_ops->ndo_init(dev);
> if (ret) {
> - if (ret > 0)
> - ret = -EIO;
> + ret = -EIO;
and:
some ndo_init() will return -ENOMEM, not only -EIO
> goto out;
> }
> }
>
next prev parent reply other threads:[~2014-02-12 8:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-12 7:45 [PATCH net-next] net: remove useless if check from register_netdevice() Denis Kirjanov
2014-02-12 8:20 ` Ding Tianhong
2014-02-12 8:24 ` Ding Tianhong [this message]
2014-02-12 8:47 ` Denis Kirjanov
2014-02-12 14:46 ` David Miller
2014-02-12 14:51 ` Denis Kirjanov
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=52FB2FBF.7050907@huawei.com \
--to=dingtianhong@huawei.com \
--cc=davem@davemloft.net \
--cc=kda@linux-powerpc.org \
--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).