Re: [PATCH net-next 1/3] net: stmmac: dwmac-loongson: Move queue number init to common function
From: Andrew Lunn
Date: Tue Apr 15 2025 - 08:25:49 EST
On Tue, Apr 15, 2025 at 03:11:26PM +0800, Huacai Chen wrote:
> Currently, the tx and rx queue number initialization is duplicated in
> loongson_gmac_data() and loongson_gnet_data(), so move it to the common
> function loongson_default_data().
>
> This is a preparation for later patches.
>
> Tested-by: Biao Dong <dongbiao@xxxxxxxxxxx>
> Signed-off-by: Baoqi Zhang <zhangbaoqi@xxxxxxxxxxx>
> Signed-off-by: Huacai Chen <chenhuacai@xxxxxxxxxxx>
> ---
> .../ethernet/stmicro/stmmac/dwmac-loongson.c | 39 +++++--------------
> 1 file changed, 9 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> index 1a93787056a7..f5fdef56da2c 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
> @@ -83,6 +83,9 @@ struct stmmac_pci_info {
> static void loongson_default_data(struct pci_dev *pdev,
> struct plat_stmmacenet_data *plat)
> {
> + int i;
> + struct loongson_data *ld = plat->bsp_priv;
Reverse Christmas tree please. Longest first, shortest last.
Andrew
---
pw-bot: cr