Re: [PATCH net-next v5 2/2] net: dsa: yt921x: Use u64_stats_t for MIB stats

From: Andrew Lunn

Date: Wed Jan 14 2026 - 08:53:47 EST


> @@ -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