Re: [PATCH net-next v8 2/6] net: dsa: motorcomm: use max_ports in series for port bounds checking
From: Andrew Lunn
Date: Tue Sep 22 2026 - 09:19:08 EST
> @@ -402,7 +403,8 @@ yt921x_mbus_int_init(struct yt921x_priv *priv, struct device_node *mnp)
> mbus->read = yt921x_mbus_int_read;
> mbus->write = yt921x_mbus_int_write;
> mbus->parent = dev;
> - mbus->phy_mask = (u32)~GENMASK(YT921X_PORT_NUM - 1, 0);
> + max_ports = priv->series->max_ports;
> + mbus->phy_mask = (u32)~GENMASK(max_ports - 1, 0);
A separate patch, but can this be changed to GENMASK_U32() so the cast
is not needed? There maybe be other instances in this driver which can
be changed as well.
Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
Andrew