[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdUv7tOc-QC8N_ie7739t07Y5A_6HQPMVR9fxW-jo_d9Ng@mail.gmail.com>
Date: Wed, 12 Nov 2025 09:49:27 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Prabhakar <prabhakar.csengg@...il.com>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
Russell King <linux@...linux.org.uk>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Horatiu Vultur <horatiu.vultur@...rochip.com>, Geert Uytterhoeven <geert+renesas@...der.be>,
Vladimir Oltean <vladimir.oltean@....com>, Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, Biju Das <biju.das.jz@...renesas.com>,
Fabrizio Castro <fabrizio.castro.jz@...esas.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Subject: Re: [PATCH net-next v3 2/3] net: phy: mscc: Consolidate probe
functions into a common helper
Hi Prabhakar,
On Tue, 11 Nov 2025 at 10:11, Prabhakar <prabhakar.csengg@...il.com> wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
>
> Unify the probe implementations of the VSC85xx PHY family into a single
> vsc85xx_probe_common() helper. The existing probe functions for the
> vsc85xx, vsc8514, vsc8574, and vsc8584 variants contained almost
> identical initialization logic, differing only in configuration
> parameters such as the number of LEDs, supported LED modes, hardware
> statistics, and PTP support.
>
> Introduce a vsc85xx_probe_config structure to describe the per-variant
> parameters, and move all common setup code into the shared helper. Each
> variant's probe function now defines a constant configuration instance
> and calls vsc85xx_probe_common().
>
> Also mark the default LED mode array parameter as const to match its
> usage.
>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
> ---
> v2->v3:
> - Grouped check_rate_magic check
Thanks for your patch!
> --- a/drivers/net/phy/mscc/mscc_main.c
> +++ b/drivers/net/phy/mscc/mscc_main.c
> @@ -22,6 +22,24 @@
> #include "mscc_serdes.h"
> #include "mscc.h"
>
> +struct vsc85xx_probe_config {
> + const struct vsc85xx_hw_stat *hw_stats;
> + u8 nleds;
> + u16 supp_led_modes;
> + size_t nstats;
> + bool use_package;
> + size_t shared_size;
> + bool has_ptp;
> + bool check_rate_magic;
> +};
Please sort by decreasing size, to reduce holes:
1. pointer and size_t,
2. u16,
3. u8 and bool.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists