From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>
Cc: 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, netdev@vger.kernel.org,
Paolo Abeni <pabeni@redhat.com>
Subject: [PATCH net-next 1/2] net: stmmac: ptp: rearrange n_ext_ts initialisation
Date: Sat, 07 Mar 2026 10:53:15 +0000 [thread overview]
Message-ID: <E1vypHX-0000000CSbc-123K@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <aawDiK7DjcSXSs1X@shell.armlinux.org.uk>
Use local variables for n_ext_ts rather than referencing the DMA
capability several times.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
index 98da499ba3b1..654d04f8c373 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
@@ -335,6 +335,7 @@ const struct ptp_clock_info dwmac1000_ptp_clock_ops = {
void stmmac_ptp_register(struct stmmac_priv *priv)
{
unsigned int pps_out_num = priv->dma_cap.pps_out_num;
+ unsigned int n_ext_ts;
int i;
if (pps_out_num > STMMAC_PPS_MAX) {
@@ -358,8 +359,9 @@ void stmmac_ptp_register(struct stmmac_priv *priv)
if (pps_out_num)
priv->ptp_clock_ops.n_per_out = pps_out_num;
- if (priv->dma_cap.aux_snapshot_n)
- priv->ptp_clock_ops.n_ext_ts = priv->dma_cap.aux_snapshot_n;
+ n_ext_ts = priv->dma_cap.aux_snapshot_n;
+ if (n_ext_ts)
+ priv->ptp_clock_ops.n_ext_ts = n_ext_ts;
if (priv->plat->ptp_max_adj)
priv->ptp_clock_ops.max_adj = priv->plat->ptp_max_adj;
--
2.47.3
next prev parent reply other threads:[~2026-03-07 10:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-07 10:52 [PATCH net-next 0/2] net: stmmac: further ptp cleanups Russell King (Oracle)
2026-03-07 10:53 ` Russell King (Oracle) [this message]
2026-03-07 10:53 ` [PATCH net-next 2/2] net: stmmac: ptp: remove redundant priv->pps[].available Russell King (Oracle)
2026-03-10 3:00 ` [PATCH net-next 0/2] net: stmmac: further ptp cleanups patchwork-bot+netdevbpf
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=E1vypHX-0000000CSbc-123K@rmk-PC.armlinux.org.uk \
--to=rmk+kernel@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=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 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.