From: Stephen Hemminger <stephen@networkplumber.org>
To: Jiri Bohac <jbohac@suse.cz>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Jiri Pirko <jiri@nvidia.com>
Subject: Re: [PATCH] net: check all name nodes in __dev_alloc_name
Date: Thu, 18 Mar 2021 11:28:19 -0700 [thread overview]
Message-ID: <20210318112819.476f7e20@hermes.local> (raw)
In-Reply-To: <20210318090652.tetotzcnoiqjtlue@dwarf.suse.cz>
On Thu, 18 Mar 2021 10:06:52 +0100
Jiri Bohac <jbohac@suse.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.
next prev parent reply other threads:[~2021-03-18 18:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-18 3:42 [PATCH] net: check all name nodes in __dev_alloc_name Jiri Bohac
2021-03-18 4:11 ` Stephen Hemminger
2021-03-18 9:06 ` Jiri Bohac
2021-03-18 18:28 ` Stephen Hemminger [this message]
2021-03-18 7:43 ` Jiri Pirko
2021-03-18 21:40 ` Andrew Lunn
2021-03-18 21:50 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210318112819.476f7e20@hermes.local \
--to=stephen@networkplumber.org \
--cc=davem@davemloft.net \
--cc=jbohac@suse.cz \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).