Re: [PATCH net-next] net: dsa: realtek: rtl8365mb: define masks using BIT() and GENMASK()

From: Alvin Šipraga

Date: Sat Oct 03 2026 - 07:27:59 EST


On Fri, Oct 02, 2026 at 11:14:57AM -0300, Luiz Angelo Daros de Luca wrote:
> Refactor register bitmask definitions to use the standard BIT() and
> GENMASK() macros instead of hardcoded hexadecimal values. This improves
> code readability, reducing the chance of errors such as unintentional
> gaps or overlaps.
>
> Introduce RTL8365MB_PORT_MASK as an alias for GENMASK(10, 0) to replace
> the repetitive 0x07FF values used across various port-related bitfields.
>
> This is a pure refactoring patch; no functional changes are introduced.
>
> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@xxxxxxxxx>

Reviewed-by: Alvin Šipraga <alvin.sipraga@xxxxxxxxxx>

> ---
> drivers/net/dsa/realtek/rtl8365mb_main.c | 168 ++++++++++++++++---------------
> drivers/net/dsa/realtek/rtl8365mb_vlan.c | 4 +-
> 2 files changed, 87 insertions(+), 85 deletions(-)