[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210318112819.476f7e20@hermes.local>
Date: Thu, 18 Mar 2021 11:28:19 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Jiri Bohac <jbohac@...e.cz>
Cc: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
Jiri Pirko <jiri@...dia.com>
Subject: Re: [PATCH] net: check all name nodes in __dev_alloc_name
On Thu, 18 Mar 2021 10:06:52 +0100
Jiri Bohac <jbohac@...e.cz> wrote:
> On Wed, Mar 17, 2021 at 09:11:08PM -0700, Stephen Hemminger wrote:
> > Rather than copy/paste same code two places, why not make a helper function?
>
> I tried and in it was ugly (too many dependencies into the
> currecnt function)
>
> Another option I considered and scratched was to opencode and
> modify list_for_each to also act on the dev->name_node
> which contains the list head. Or maybe one of the
> list_for_each_* variants could be directly misused for that.
That seems like overly complex and unhelpful option.
> I don't understand why this has been designed in such a
> non-standard way; why is the first node not part of the list and
> the head directly in the net_device?
>
> In the end I considered the copy'n'paste of 9 lines the least
> ugly and most readable.
>
Sure, make sense.
Powered by blists - more mailing lists