]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: stmmac: move stmmac_xmit() initial variable init
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 20 Mar 2026 16:47:27 +0000 (16:47 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 24 Mar 2026 11:08:25 +0000 (12:08 +0100)
Move tx_q, first_tx and txq_stats just before their first use.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1w3d0R-0000000DfM1-1itN@rmk-PC.armlinux.org.uk
Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index 84de1134d5817afd311a58d48852ee4689988a40..58a84570821cda37d59398eae9812ddd7e5738d5 100644 (file)
@@ -4685,10 +4685,6 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
        dma_addr_t dma_addr;
        u32 sdu_len;
 
-       tx_q = &priv->dma_conf.tx_queue[queue];
-       txq_stats = &priv->xstats.txq_stats[queue];
-       first_tx = tx_q->cur_tx;
-
        if (priv->tx_path_in_lpi_mode && priv->eee_sw_timer_en)
                stmmac_stop_sw_lpi(priv);
 
@@ -4725,6 +4721,9 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
                return NETDEV_TX_BUSY;
        }
 
+       tx_q = &priv->dma_conf.tx_queue[queue];
+       first_tx = tx_q->cur_tx;
+
        /* Check if VLAN can be inserted by HW */
        has_vlan = stmmac_vlan_insert(priv, skb, tx_q);
 
@@ -4882,6 +4881,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
                netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, queue));
        }
 
+       txq_stats = &priv->xstats.txq_stats[queue];
        u64_stats_update_begin(&txq_stats->q_syncp);
        u64_stats_add(&txq_stats->q.tx_bytes, skb->len);
        if (set_ic)