linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/8] net: stmmac: hwif.c cleanups
@ 2025-10-24 12:48 Russell King (Oracle)
  2025-10-24 12:49 ` [PATCH net-next v2 1/8] net: stmmac: move version handling into own function Russell King (Oracle)
                   ` (9 more replies)
  0 siblings, 10 replies; 18+ messages in thread
From: Russell King (Oracle) @ 2025-10-24 12:48 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, linux-arm-kernel, linux-stm32, Maxime Coquelin,
	netdev, Paolo Abeni, Richard Cochran

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.

---
v2:
- fix "verison" typo, impacting patches 2, 3, and 4.
- added reviewed-by / tested-bys

 drivers/net/ethernet/stmicro/stmmac/common.h |   3 +
 drivers/net/ethernet/stmicro/stmmac/hwif.c   | 166 +++++++++++++++------------
 2 files changed, 98 insertions(+), 71 deletions(-)
 
-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!


^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCH net-next 0/8] net: stmmac: hwif.c cleanups
@ 2025-10-23  9:36 Russell King (Oracle)
  2025-10-24  6:44 ` Maxime Chevallier
  0 siblings, 1 reply; 18+ messages in thread
From: Russell King (Oracle) @ 2025-10-23  9:36 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit
  Cc: Alexandre Torgue, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, linux-arm-kernel, linux-stm32, Maxime Coquelin,
	netdev, Paolo Abeni, Richard Cochran

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(-)
 
-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2025-10-29  0:10 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-24 12:48 [PATCH net-next 0/8] net: stmmac: hwif.c cleanups Russell King (Oracle)
2025-10-24 12:49 ` [PATCH net-next v2 1/8] net: stmmac: move version handling into own function Russell King (Oracle)
2025-10-24 12:49 ` [PATCH net-next v2 2/8] net: stmmac: simplify stmmac_get_version() Russell King (Oracle)
2025-10-24 12:49 ` [PATCH net-next v2 3/8] net: stmmac: consolidate version reading and validation Russell King (Oracle)
2025-10-24 12:49 ` [PATCH net-next v2 4/8] net: stmmac: move stmmac_get_*id() into stmmac_get_version() Russell King (Oracle)
2025-10-24 12:49 ` [PATCH net-next v2 5/8] net: stmmac: use FIELD_GET() for version register Russell King (Oracle)
2025-10-24 12:49 ` [PATCH net-next v2 6/8] net: stmmac: provide function to lookup hwif Russell King (Oracle)
2025-10-24 12:49 ` [PATCH net-next v2 7/8] net: stmmac: use != rather than ^ for comparing dev_id Russell King (Oracle)
2025-10-24 12:49 ` [PATCH net-next v2 8/8] net: stmmac: reorganise stmmac_hwif_init() Russell King (Oracle)
2025-10-24 20:22 ` [PATCH net-next 0/8] net: stmmac: hwif.c cleanups 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
  -- strict thread matches above, loose matches on Subject: below --
2025-10-23  9:36 Russell King (Oracle)
2025-10-24  6:44 ` Maxime Chevallier
2025-10-24 10:48   ` Russell King (Oracle)
2025-10-24 10:53     ` Maxime Chevallier

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).