From: Uday Shankar <ushankar@purestorage.com>
To: David Laight <david.laight.linux@gmail.com>
Cc: "Breno Leitao" <leitao@debian.org>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Srinivas Kandagatla" <srinivas.kandagatla@linaro.org>,
"Rafał Miłecki" <rafal@milecki.pl>,
"Simon Horman" <horms@kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Johannes Berg" <johannes@sipsolutions.net>,
"Jonathan Corbet" <corbet@lwn.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-wireless@vger.kernel.org, linux-doc@vger.kernel.org,
"Michal Swiatkowski" <michal.swiatkowski@linux.intel.com>
Subject: Re: [PATCH net-next v5 1/2] net, treewide: define and use MAC_ADDR_STR_LEN
Date: Fri, 21 Feb 2025 12:46:03 -0700 [thread overview]
Message-ID: <Z7jX+z/Ucq5iu5bS@dev-ushankar.dev.purestorage.com> (raw)
In-Reply-To: <20250221131750.0630c720@pumpkin>
On Fri, Feb 21, 2025 at 01:17:50PM +0000, David Laight wrote:
> The fact that you have to keep adding 1 or 2 is a good indication that
> it really isn't a good idea.
Having to adjust by 1 when converting between string lengths and buffer
sizes is super standard in C since strings are NUL-terminated. There are
tons of preexisting examples in the tree.
I agree that the + 2 is a bit of an eyesore but its needed in that case
because that code wants to tack on a newline in addition to a
NUL-terminator. Maybe adding a comment there would help?
In any case, MAC_ADDR_STR_LEN is a much more descriptive name for what
all the changed code is actually doing compared against 3 * ETH_ALEN -
1.
next prev parent reply other threads:[~2025-02-21 19:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-21 1:29 [PATCH net-next v5 0/2] netconsole: allow selection of egress interface via MAC address Uday Shankar
2025-02-21 1:29 ` [PATCH net-next v5 1/2] net, treewide: define and use MAC_ADDR_STR_LEN Uday Shankar
2025-02-21 9:37 ` Breno Leitao
2025-02-21 13:17 ` David Laight
2025-02-21 19:46 ` Uday Shankar [this message]
2025-02-25 14:40 ` Simon Horman
2025-02-21 1:29 ` [PATCH net-next v5 2/2] netconsole: allow selection of egress interface via MAC address Uday Shankar
2025-02-25 14:40 ` Simon Horman
2025-03-07 20:11 ` Uday Shankar
2025-03-11 11:13 ` Simon Horman
2025-03-12 19:37 ` Jakub Kicinski
2025-03-17 20:43 ` Uday Shankar
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=Z7jX+z/Ucq5iu5bS@dev-ushankar.dev.purestorage.com \
--to=ushankar@purestorage.com \
--cc=akpm@linux-foundation.org \
--cc=andrew+netdev@lunn.ch \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=david.laight.linux@gmail.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=leitao@debian.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=michal.swiatkowski@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rafal@milecki.pl \
--cc=srinivas.kandagatla@linaro.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).