Re: [PATCH net-next] net: dsa: realtek: use <module>-y in Makefile

From: Alvin Šipraga

Date: Mon Oct 19 2026 - 09:07:55 EST


On Mon, Oct 19, 2026 at 01:26:27AM -0300, Luiz Angelo Daros de Luca wrote:
> Switch from <module>-objs to <module>-y to eliminate ifdefs and simplify
> conditional object list construction. Drop the obsolete trailing
> comment.
>
> Signed-off-by: Luiz Angelo Daros de Luca <luizluca@xxxxxxxxx>

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

> ---
> drivers/net/dsa/realtek/Makefile | 28 ++++++++++------------------
> 1 file changed, 10 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/net/dsa/realtek/Makefile b/drivers/net/dsa/realtek/Makefile
> index 72bb42e80c95..0a94a619b2c1 100644
> --- a/drivers/net/dsa/realtek/Makefile
> +++ b/drivers/net/dsa/realtek/Makefile
> @@ -1,23 +1,15 @@
> # SPDX-License-Identifier: GPL-2.0
> obj-$(CONFIG_NET_DSA_REALTEK) += realtek_dsa.o
> -realtek_dsa-objs := rtl83xx.o
> -
> -ifdef CONFIG_NET_DSA_REALTEK_MDIO
> -realtek_dsa-objs += realtek-mdio.o
> -endif
> -
> -ifdef CONFIG_NET_DSA_REALTEK_SMI
> -realtek_dsa-objs += realtek-smi.o
> -endif
> +realtek_dsa-y := rtl83xx.o
> +realtek_dsa-$(CONFIG_NET_DSA_REALTEK_MDIO) += realtek-mdio.o
> +realtek_dsa-$(CONFIG_NET_DSA_REALTEK_SMI) += realtek-smi.o
>
> obj-$(CONFIG_NET_DSA_REALTEK_RTL8366RB) += rtl8366.o
> -rtl8366-objs := rtl8366-core.o rtl8366rb.o
> -ifdef CONFIG_NET_DSA_REALTEK_RTL8366RB_LEDS
> -rtl8366-objs += rtl8366rb-leds.o
> -endif
> +rtl8366-y := rtl8366-core.o rtl8366rb.o
> +rtl8366-$(CONFIG_NET_DSA_REALTEK_RTL8366RB_LEDS) += rtl8366rb-leds.o
> +
> obj-$(CONFIG_NET_DSA_REALTEK_RTL8365MB) += rtl8365mb.o
> -rtl8365mb-objs := rtl8365mb_main.o \
> - rtl8365mb_table.o \
> - rtl8365mb_vlan.o \
> - rtl8365mb_l2.o \
> -# end of rtl8365mb-objs
> +rtl8365mb-y := rtl8365mb_main.o \
> + rtl8365mb_table.o \
> + rtl8365mb_vlan.o \
> + rtl8365mb_l2.o
>
> ---
> base-commit: 98c2ad4f5d805dbc1ea436a334ee59311806a48c
> change-id: 20261019-realtek_mkf-380d67738b1d
>
> Best regards,
> --
> Luiz Angelo Daros de Luca <luizluca@xxxxxxxxx>
>