[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210318090652.tetotzcnoiqjtlue@dwarf.suse.cz>
Date: Thu, 18 Mar 2021 10:06:52 +0100
From: Jiri Bohac <jbohac@...e.cz>
To: Stephen Hemminger <stephen@...workplumber.org>
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 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.
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.
--
Jiri Bohac <jbohac@...e.cz>
SUSE Labs, Prague, Czechia
Powered by blists - more mailing lists