public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jose Abreu <Jose.Abreu@synopsys•com>
To: netdev@vger•kernel.org
Cc: Jose Abreu <Jose.Abreu@synopsys•com>,
	"David S. Miller" <davem@davemloft•net>,
	Joao Pinto <Joao.Pinto@synopsys•com>,
	Giuseppe Cavallaro <peppe.cavallaro@st•com>,
	Alexandre Torgue <alexandre.torgue@st•com>
Subject: [PATCH net-next 0/5] net: stmmac: Stop using hard-coded callbacks
Date: Fri,  6 Apr 2018 14:08:14 +0100	[thread overview]
Message-ID: <cover.1523019346.git.joabreu@synopsys.com> (raw)

This a starting point for a cleanup and re-organization of stmmac.

In this series we stop using hard-coded callbacks along the code and use
instead helpers which are defined in a single place ("hwif.h").

This brings several advantages:
	1) Less typing :)
	2) Guaranteed function pointer check
	3) More flexibility

By 2) we stop using the repeated pattern of:
	if (priv->hw->mac->some_func)
		priv->hw->mac->some_func(...)

I didn't check but I expect the final .ko will be bigger with this series
because *all* of function pointers are checked.

Anyway, I hope this can make the code more readable and more flexible now.

Cc: David S. Miller <davem@davemloft•net>
Cc: Joao Pinto <jpinto@synopsys•com>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st•com>
Cc: Alexandre Torgue <alexandre.torgue@st•com>

Jose Abreu (5):
  net: stmmac: Switch stmmac_desc_ops to generic HW Interface Helpers
  net: stmmac: Switch stmmac_dma_ops to generic HW Interface Helpers
  net: stmmac: Switch stmmac_ops to generic HW Interface Helpers
  net: stmmac: Switch stmmac_hwtimestamp to generic HW Interface Helpers
  net: stmmac: Switch stmmac_mode_ops to generic HW Interface Helpers

 drivers/net/ethernet/stmicro/stmmac/chain_mode.c   |  34 +-
 drivers/net/ethernet/stmicro/stmmac/common.h       | 199 +---------
 drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c |   4 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac5.c       |  19 +-
 drivers/net/ethernet/stmicro/stmmac/dwmac5.h       |   6 +-
 drivers/net/ethernet/stmicro/stmmac/enh_desc.c     |   4 +-
 drivers/net/ethernet/stmicro/stmmac/hwif.h         | 421 ++++++++++++++++++++
 drivers/net/ethernet/stmicro/stmmac/norm_desc.c    |   4 +-
 drivers/net/ethernet/stmicro/stmmac/ring_mode.c    |  39 +-
 .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c   |  82 ++--
 .../net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c  |  34 +-
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c  | 439 +++++++++------------
 drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c   |  18 +-
 13 files changed, 726 insertions(+), 577 deletions(-)
 create mode 100644 drivers/net/ethernet/stmicro/stmmac/hwif.h

-- 
2.9.3

             reply	other threads:[~2018-04-06 13:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-06 13:08 Jose Abreu [this message]
2018-04-06 13:08 ` [PATCH net-next 1/5] net: stmmac: Switch stmmac_desc_ops to generic HW Interface Helpers Jose Abreu
2018-04-06 13:08 ` [PATCH net-next 2/5] net: stmmac: Switch stmmac_dma_ops " Jose Abreu
2018-04-06 13:08 ` [PATCH net-next 3/5] net: stmmac: Switch stmmac_ops " Jose Abreu
2018-04-06 13:08 ` [PATCH net-next 4/5] net: stmmac: Switch stmmac_hwtimestamp " Jose Abreu
2018-04-06 13:08 ` [PATCH net-next 5/5] net: stmmac: Switch stmmac_mode_ops " Jose Abreu
2018-04-06 15:12 ` [PATCH net-next 0/5] net: stmmac: Stop using hard-coded callbacks David Miller
2018-04-16 22:50 ` David Miller

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=cover.1523019346.git.joabreu@synopsys.com \
    --to=jose.abreu@synopsys$(echo .)com \
    --cc=Joao.Pinto@synopsys$(echo .)com \
    --cc=alexandre.torgue@st$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=peppe.cavallaro@st$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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