]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: stmmac: ptp: rearrange n_ext_ts initialisation
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Sat, 7 Mar 2026 10:53:15 +0000 (10:53 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 10 Mar 2026 02:45:26 +0000 (19:45 -0700)
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>
Link: https://patch.msgid.link/E1vypHX-0000000CSbc-123K@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c

index 98da499ba3b15c5fd36a9b58a70ac388d1defa75..654d04f8c373a7f796d73b5e904f95186a811365 100644 (file)
@@ -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;