[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231020120149.3a569db7@kernel.org>
Date: Fri, 20 Oct 2023 12:01:49 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Jiri Pirko <jiri@...nulli.us>
Cc: davem@...emloft.net, netdev@...r.kernel.org, edumazet@...gle.com,
pabeni@...hat.com, johannes.berg@...el.com, mpe@...erman.id.au, j@...fi
Subject: Re: [PATCH net-next 2/6] net: make dev_alloc_name() call
dev_prep_valid_name()
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
Powered by blists - more mailing lists