Re: [PATCH net-next v6 3/3] net: dsa: yt921x: Add support for Motorcomm YT921x

From: Andrew Lunn
Date: Sun Aug 24 2025 - 11:26:27 EST


> +#define yt921x_port_is_internal(port) ((port) < 8)
> +#define yt921x_port_is_external(port) (8 <= (port) && (port) < 9)

> +#define yt921x_info_port_is_internal(info, port) \
> + ((info)->internal_mask & BIT(port))
> +#define yt921x_info_port_is_external(info, port) \
> + ((info)->external_mask & BIT(port))

Do we really need two sets of macros?

And is there a third state? Can a port be not internal and not
external?

Maybe the code can just use !yt921x_info_port_is_internal(info, port)

Andrew