Re: [PATCH net-next v5 2/6] net: dsa: motorcomm: use max_ports from series_info for port bounds checking

From: Kyle Switch

Date: Sat Sep 05 2026 - 21:51:46 EST



On 9/4/26 21:32, Andrew Lunn wrote:
On Fri, Sep 04, 2026 at 05:54:12PM +0800, Kyle Switch wrote:
Replace the hardcoded YT921X_PORT_NUM macro with the per-series
max_ports field in port validation. This removes family-specific
constants from the common code path and simplifies adding new
switch families with different port counts.

No functional change for existing YT921X devices.

Signed-off-by: Kyle Switch <kyle.switch@xxxxxxxxxxxxxx>
Did you review your own patch? Don't you think it is now a lot easier
to see this patch is correct, now that it is short, does one thing and
have a commit message focused on just this change.

Ans: yes, by splitting patches so that each patch contains only

one functionality, it becomes more convenient and easier to review

the code logic and whether there are errors. We will follow a similar

approach going forward.

Reviewed-by: Andrew Lunn <andrew@xxxxxxx>

Andrew