Re: [PATCH net-next 1/3] net: stmmac: dwmac-loongson: Move queue number init to common function

From: Huacai Chen
Date: Wed Apr 16 2025 - 06:13:04 EST


On Tue, Apr 15, 2025 at 10:49 PM Andrew Lunn <andrew@xxxxxxx> wrote:
>
> 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.
OK, I think it is better to move "int i" to the for-loop.

Huacai

>
> Andrew
>
> ---
> pw-bot: cr
>
>