Subject: Re: [PATCH] net-2.6 : fix dev_get_valid_name

From: Daniel Lezcano <[email-masked]>
Date: Tue, 18 May 2010 21:55:05 +0200

On 05/18/2010 07:54 PM, Stephen Hemminger wrote:
> On Tue, 18 May 2010 19:35:12 +0200
> Daniel Lezcano<[email-masked]>  wrote:
>
>    
>> +static int dev_get_valid_name(struct net_device *dev, const char *name, bool fmt)
>>   {
>> +	struct net *net;
>> +
>> +	BUG_ON(!dev_net(dev));
>> +	net = dev_net(dev);
>>      
> This is not really part of the same fix. And not sure why it is added here?
>    

I could have created a temporary buffer within the function and have 
passed it to __dev_alloc_name but this is exactly what does 
'dev_alloc_name'.
So 'dev_alloc_name' replaces '__dev_alloc_name' but takes a 'dev' 
parameter which is not passed to 'dev_get_valid_name'.
Instead of passing an extra parameter 'dev', I just replaced the 'net' 
parameter by the 'dev' parameter and extracted the 'net' pointer from it.

I have a few patches cleaning up these functions and the callers but I 
prefer to send them against net-next-2.6.