lkml.org 
[lkml]   [2012]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] can: rename LED trigger name on netdev renames
On 10.09.2012 22:08, Kurt Van Dijck wrote:

> On Mon, Sep 10, 2012 at 09:01:21PM +0200, Oliver Hartkopp wrote:

>>>>> + if (msg == NETDEV_CHANGENAME) {
>>
>>
>> I do have a second remark.
>>
>> What about always using the notifiers to name the LED triggers?
>>
>> Looking into
>>
>> http://lxr.linux.no/#linux+v3.5.3/include/linux/netdevice.h#L1526
>>
>> we have NETDEV_CHANGENAME but what about
>>
>> NETDEV_REGISTER
>>
>> ???
>>
>> When changing and updating the LED trigger name always inside the notifier, we
>> should never run into any locking or race conditions ...
>>
>> What do you think about this idea?
>>
> But the initial name must have been set properly already in that case...
>


Yes it is.

See register_netdevice()

http://lxr.linux.no/#linux+v3.5.3/net/core/dev.c#L5453


at the end NETDEV_REGISTER is notified:

http://lxr.linux.no/#linux+v3.5.3/net/core/dev.c#L5552

So it would be pretty elegant to create the LED trigger name in the notifier.
This would allow to remove that code at the current init function too.

Regards,
Oliver


\
 
 \ /
  Last update: 2012-09-11 08:21    [W:0.070 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site