From: Vladimir Oltean <olteanv@gmail.com>
To: Justin Stitt <justinstitt@google.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH] net: dsa: vsc73xx: replace deprecated strncpy with ethtool_sprintf
Date: Wed, 11 Oct 2023 01:13:54 +0300 [thread overview]
Message-ID: <20231010221354.nk3fnypx64rvwr7e@skbuf> (raw)
In-Reply-To: <CAFhGd8pF04DCbMJFOR+93azqzWYZ2aE9FByp7yVVJR90g7MN9g@mail.gmail.com>
On Tue, Oct 10, 2023 at 10:44:42AM -0700, Justin Stitt wrote:
> Wow, thanks for the feedback here. I agree that the current
> proposal is problematic. I wonder what you think about
> using a ternary to avoid smelly code dupe:
>
> for (i = 0; i < 3; i++) {
> cnt = vsc73xx_find_counter(vsc, indices[i], false);
> ethtool_sprintf(&buf, "%s", cnt ? cnt->name : "");
> }
Looks like that would address my comment, and it looks okay.
next prev parent reply other threads:[~2023-10-10 22:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-09 22:54 [PATCH] net: dsa: vsc73xx: replace deprecated strncpy with ethtool_sprintf Justin Stitt
2023-10-09 23:12 ` Florian Fainelli
2023-10-10 11:20 ` Vladimir Oltean
2023-10-10 17:44 ` Justin Stitt
2023-10-10 22:13 ` Vladimir Oltean [this message]
2023-10-10 21:49 ` Justin Stitt
2023-10-10 22:12 ` Vladimir Oltean
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=20231010221354.nk3fnypx64rvwr7e@skbuf \
--to=olteanv@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=justinstitt@google.com \
--cc=kuba@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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