[lkml]   [2017]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] can: Use common error handling code in vxcan_newlink()
>> @@ -227,10 +227,8 @@ static int vxcan_newlink(struct net *net, struct net_device *dev,
>>       netif_carrier_off(peer);
>>         err = rtnl_configure_link(peer, ifmp);
>> -    if (err < 0) {
>> -        unregister_netdevice(peer);
>> -        return err;
>> -    }
>> +    if (err)
>> +        goto unregister_network_device;
> You are changing semantic in the if-statement here.

I got an other software development opinion for this implementation detail.

The success predicate for the function “rtnl_configure_link” is that
the return value is zero. I would prefer to treat other values as
an error code then.

> I would be fine with the patch

Thanks for a bit of change acceptance.

> if you revert that if-statement as I would like to stay on the behavior
> from veth.c in veth_newlink().

Will another bit of clarification be useful around the usage of error predicates?


 \ /
  Last update: 2017-10-28 20:22    [W:0.061 / U:2.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site