From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-stm32@st-md-mailman.stormreply.com,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Richard Cochran <richardcochran@gmail.com>
Subject: Re: [PATCH net-next 0/8] net: stmmac: hwif.c cleanups
Date: Fri, 24 Oct 2025 11:48:35 +0100 [thread overview]
Message-ID: <aPtZg_v3H53hiQXo@shell.armlinux.org.uk> (raw)
In-Reply-To: <28d91eca-28dd-4e5b-ae60-021e777ee064@bootlin.com>
On Fri, Oct 24, 2025 at 08:44:07AM +0200, Maxime Chevallier wrote:
> Hello Russell,
>
> On 23/10/2025 11:36, Russell King (Oracle) wrote:
> > Hi,
> >
> > This series cleans up hwif.c:
> >
> > - move the reading of the version information out of stmmac_hwif_init()
> > into its own function, stmmac_get_version(), storing the result in a
> > new struct.
> >
> > - simplify stmmac_get_version().
> >
> > - read the version register once, passing it to stmmac_get_id() and
> > stmmac_get_dev_id().
> >
> > - move stmmac_get_id() and stmmac_get_dev_id() into
> > stmmac_get_version()
> >
> > - define version register fields and use FIELD_GET() to decode
> >
> > - start tackling the big loop in stmmac_hwif_init() - provide a
> > function, stmmac_hwif_find(), which looks up the hwif entry, thus
> > making a much smaller loop, which improves readability of this code.
> >
> > - change the use of '^' to '!=' when comparing the dev_id, which is
> > what is really meant here.
> >
> > - reorganise the test after calling stmmac_hwif_init() so that we
> > handle the error case in the indented code, and the success case
> > with no indent, which is the classical arrangement.
> >
> > drivers/net/ethernet/stmicro/stmmac/common.h | 3 +
> > drivers/net/ethernet/stmicro/stmmac/hwif.c | 166 +++++++++++++++------------
> > 2 files changed, 98 insertions(+), 71 deletions(-)
>
> I didn't have the bandwidth to do a full review, however I ran tests
> with this series on dwmac-socfpga and dwmac-stm32, no regressions found.
>
> For the series,
>
> Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Thanks, it's good to have someone else testing. I do need to post v2
with some tweaks to patches 2, 3 and 4 due to a typo that gets
eliminated in later patches. "verison*" -> "version*" in one instance.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2025-10-24 10:48 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 9:36 [PATCH net-next 0/8] net: stmmac: hwif.c cleanups Russell King (Oracle)
2025-10-23 9:37 ` [PATCH net-next 1/8] net: stmmac: move version handling into own function Russell King (Oracle)
2025-10-23 18:44 ` Andrew Lunn
2025-10-23 9:37 ` [PATCH net-next 2/8] net: stmmac: simplify stmmac_get_version() Russell King (Oracle)
2025-10-23 18:46 ` Andrew Lunn
2025-10-24 11:10 ` Russell King (Oracle)
2025-10-24 11:54 ` Andrew Lunn
2025-10-23 9:37 ` [PATCH net-next 3/8] net: stmmac: consolidate version reading and validation Russell King (Oracle)
2025-10-23 18:48 ` Andrew Lunn
2025-10-23 9:37 ` [PATCH net-next 4/8] net: stmmac: move stmmac_get_*id() into stmmac_get_version() Russell King (Oracle)
2025-10-23 18:48 ` Andrew Lunn
2025-10-23 9:37 ` [PATCH net-next 5/8] net: stmmac: use FIELD_GET() for version register Russell King (Oracle)
2025-10-23 18:49 ` Andrew Lunn
2025-10-23 9:37 ` [PATCH net-next 6/8] net: stmmac: provide function to lookup hwif Russell King (Oracle)
2025-10-23 18:51 ` Andrew Lunn
2025-10-23 9:37 ` [PATCH net-next 7/8] net: stmmac: use != rather than ^ for comparing dev_id Russell King (Oracle)
2025-10-23 18:51 ` Andrew Lunn
2025-10-23 9:38 ` [PATCH net-next 8/8] net: stmmac: reorganise stmmac_hwif_init() Russell King (Oracle)
2025-10-23 18:52 ` Andrew Lunn
2025-10-24 6:44 ` [PATCH net-next 0/8] net: stmmac: hwif.c cleanups Maxime Chevallier
2025-10-24 10:48 ` Russell King (Oracle) [this message]
2025-10-24 10:53 ` Maxime Chevallier
-- strict thread matches above, loose matches on Subject: below --
2025-10-24 12:48 Russell King (Oracle)
2025-10-24 20:22 ` Mohd Ayaan Anwar
2025-10-28 23:42 ` Jakub Kicinski
2025-10-28 23:54 ` Russell King (Oracle)
2025-10-28 23:57 ` Russell King (Oracle)
2025-10-29 0:10 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aPtZg_v3H53hiQXo@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).