Thread (7 messages) flat view 7 messages, 5 authors, 2021-03-18

Re: [PATCH] net: check all name nodes in __dev_alloc_name

From: Jiri Bohac <hidden>
Date: 2021-03-18 09:07:33

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 [off-list ref]
SUSE Labs, Prague, Czechia
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help