From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Feiyang Chen <chenfeiyang@loongson.cn>
Cc: andrew@lunn.ch, hkallweit1@gmail.com, peppe.cavallaro@st.com,
alexandre.torgue@foss.st.com, joabreu@synopsys.com,
chenhuacai@loongson.cn, dongbiao@loongson.cn,
guyinggang@loongson.cn, siyanteng@loongson.cn,
loongson-kernel@lists.loongnix.cn, netdev@vger.kernel.org,
loongarch@lists.linux.dev, chris.chenfeiyang@gmail.com
Subject: Re: [PATCH v4 01/11] net: stmmac: Pass stmmac_priv and chan in some callbacks
Date: Tue, 22 Aug 2023 11:03:00 +0100 [thread overview]
Message-ID: <ZOSH1GxHkWbDGSLj@shell.armlinux.org.uk> (raw)
In-Reply-To: <e452ba21887e37a747f8d4f0f74ef4f2590c3eac.1692696115.git.chenfeiyang@loongson.cn>
On Tue, Aug 22, 2023 at 05:40:26PM +0800, Feiyang Chen wrote:
> @@ -636,7 +637,8 @@ static void sun8i_dwmac_set_mac(void __iomem *ioaddr, bool enable)
> * All slot > 0 need to be enabled with MAC_ADDR_TYPE_DST
> * If addr is NULL, clear the slot
> */
> -static void sun8i_dwmac_set_umac_addr(struct mac_device_info *hw,
> +static void sun8i_dwmac_set_umac_addr(struct stmmac_priv *priv,
> + struct mac_device_info *hw,
> const unsigned char *addr,
> unsigned int reg_n)
> {
Given that hw is always priv->hw, would it be sensible to simplify the
callback by dropping the "hw" argument, and have the called methods do:
struct mac_device_info *hw = priv->hw;
> @@ -657,7 +659,8 @@ static void sun8i_dwmac_set_umac_addr(struct mac_device_info *hw,
> }
> }
>
> -static void sun8i_dwmac_get_umac_addr(struct mac_device_info *hw,
> +static void sun8i_dwmac_get_umac_addr(struct stmmac_priv *priv,
> + struct mac_device_info *hw,
> unsigned char *addr,
> unsigned int reg_n)
> {
Same here.
> @@ -680,7 +683,8 @@ static int sun8i_dwmac_rx_ipc_enable(struct mac_device_info *hw)
> return 1;
> }
>
> -static void sun8i_dwmac_set_filter(struct mac_device_info *hw,
> +static void sun8i_dwmac_set_filter(struct stmmac_priv *priv,
> + struct mac_device_info *hw,
> struct net_device *dev)
> {
Probably also worth doing for this method as well. I think the only
thing which this function uses is hw->unicast_filter_entries, so
one could declare:
unsigned int unicast_filter_entries = priv->hw->unicast_filter_entries;
rather than carrying the pointer to both "priv" and "hw" through this
function.
--
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:[~2023-08-22 10:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 9:40 [PATCH v4 00/11] stmmac: Add Loongson platform support Feiyang Chen
2023-08-22 9:40 ` [PATCH v4 01/11] net: stmmac: Pass stmmac_priv and chan in some callbacks Feiyang Chen
2023-08-22 10:03 ` Russell King (Oracle) [this message]
2023-08-22 9:40 ` [PATCH v4 02/11] stmmac: dwmac1000: Add 64-bit DMA support Feiyang Chen
2023-08-22 9:40 ` [PATCH v4 03/11] stmmac: Add extended GMAC support for Loongson platforms Feiyang Chen
2023-08-22 16:13 ` Serge Semin
2023-08-22 9:40 ` [PATCH v4 04/11] net: stmmac: Allow platforms to set irq_flags Feiyang Chen
2023-08-22 9:40 ` [PATCH v4 05/11] net: stmmac: dwmac-loongson: Refactor code for loongson_dwmac_probe() Feiyang Chen
2023-08-22 9:40 ` [PATCH v4 06/11] net: stmmac: dwmac-loongson: Add LS7A support Feiyang Chen
2023-08-22 9:40 ` [PATCH v4 07/11] net: stmmac: dwmac-loongson: Add 64-bit DMA and MSI support Feiyang Chen
2023-08-22 9:41 ` [PATCH v4 08/11] net: stmmac: dwegmac: Fix channel numbers Feiyang Chen
2023-08-22 9:41 ` [PATCH v4 09/11] net: stmmac: dwmac-loongson: Disable flow control for GMAC Feiyang Chen
2023-08-22 9:41 ` [PATCH v4 10/11] net: stmmac: dwegmac: Disable coe Feiyang Chen
2023-08-22 9:41 ` [PATCH v4 11/11] net: stmmac: dwmac-loongson: Add GNET support Feiyang Chen
2023-08-22 11:45 ` Russell King (Oracle)
2023-08-24 1:47 ` [PATCH v4 00/11] stmmac: Add Loongson platform support Feiyang Chen
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=ZOSH1GxHkWbDGSLj@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew@lunn.ch \
--cc=chenfeiyang@loongson.cn \
--cc=chenhuacai@loongson.cn \
--cc=chris.chenfeiyang@gmail.com \
--cc=dongbiao@loongson.cn \
--cc=guyinggang@loongson.cn \
--cc=hkallweit1@gmail.com \
--cc=joabreu@synopsys.com \
--cc=loongarch@lists.linux.dev \
--cc=loongson-kernel@lists.loongnix.cn \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.com \
--cc=siyanteng@loongson.cn \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.