[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOJe8K32nXmX9X+OceP9e5gb-KwJKfAts=zeaDGUU-+R1Q8oaw@mail.gmail.com>
Date: Wed, 12 Feb 2014 12:47:22 +0400
From: Denis Kirjanov <kda@...ux-powerpc.org>
To: Ding Tianhong <dingtianhong@...wei.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] net: remove useless if check from register_netdevice()
On 2/12/14, Ding Tianhong <dingtianhong@...wei.com> wrote:
> On 2014/2/12 15:45, Denis Kirjanov wrote:
>> remove useless if check from register_netdevice()
>>
>> Signed-off-by: Denis Kirjanov <kda@...ux-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;
>> }
>> }
>>
Yes, I was thinking about that. The return code may contain everything.
Probably it's better to propagate return value back to
register_netdevice. On the other hand the return value -ENOTSUPP for
register_netdevice return value looks odd...
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists