Subject: Re: [PATCH net-next 2/6] net: make dev_alloc_name() call dev_prep_valid_name()

From: Jiri Pirko <[email-masked]>
Date: Sat, 21 Oct 2023 09:01:58 +0200

Fri, Oct 20, 2023 at 09:01:49PM CEST, [email-masked] wrote:
>On Fri, 20 Oct 2023 12:24:57 +0200 Jiri Pirko wrote:
>> > static int dev_get_valid_name(struct net *net, struct net_device *dev,
>> > 			      const char *name)
>> > {
>> >-	return dev_prep_valid_name(net, dev, name, dev->name);
>> >+	int ret;
>> >+
>> >+	ret = dev_prep_valid_name(net, dev, name, dev->name, EEXIST);
>> >+	return ret < 0 ? ret : 0;  
>> 
>> Why can't you just return dev_prep_valid_name() ?
>> 
>> No caller seems to care about ret > 0
>
>AFACT dev_change_name() has some weird code that ends up return 
>the value all the way to the ioctl and user space. Note that it
>has both err and ret variables :S

Ah, blah. Guess we are stick to this crap :/

Reviewed-by: Jiri Pirko <[email-masked]>