From: Andrew Lunn <andrew@lunn.ch>
To: David Yang <mmyangfl@gmail.com>
Cc: netdev@vger.kernel.org, Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v5 2/2] net: dsa: yt921x: Use u64_stats_t for MIB stats
Date: Wed, 14 Jan 2026 14:53:40 +0100 [thread overview]
Message-ID: <aea64441-9e8b-4a1d-bd7e-cd09148451dc@lunn.ch> (raw)
In-Reply-To: <20260114114745.213252-3-mmyangfl@gmail.com>
> @@ -690,7 +689,7 @@ static int yt921x_read_mib(struct yt921x_priv *priv, int port)
> break;
>
> if (desc->size <= 1) {
> - u64 old_val = *valp;
> + u64 old_val = u64_stats_read(&((u64_stats_t *)mib)[i]);
You do seem to like using casts, despite review comments saying they
should be avoided. Look at other users of u64_stats_read(). How many
have casts? Please see if you can get the types correct so this cast
is not needed.
> - if (res)
> + if (res) {
> dev_err(dev, "Failed to %s port %d: %i\n", "read stats for",
> port, res);
> - return res;
> + return res;
> + }
This is logically a different change. Please put it into a patch of
its own. You want lots of small patches, with good commit messages,
which are obviously correct.
Andrew
---
pw-bot: cr
prev parent reply other threads:[~2026-01-14 13:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-14 11:47 [PATCH net-next v5 0/2] net: dsa: yt921x: Fix MIB overflow wraparound routine David Yang
2026-01-14 11:47 ` [PATCH net-next v5 1/2] " David Yang
2026-01-14 11:47 ` [PATCH net-next v5 2/2] net: dsa: yt921x: Use u64_stats_t for MIB stats David Yang
2026-01-14 13:53 ` Andrew Lunn [this message]
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=aea64441-9e8b-4a1d-bd7e-cd09148451dc@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmyangfl@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--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