]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hinic3: remove tx_q name collision hack
authorGur Stavi <gur.stavi@huawei.com>
Mon, 9 Jun 2025 15:07:54 +0000 (18:07 +0300)
committerJakub Kicinski <kuba@kernel.org>
Tue, 10 Jun 2025 22:27:19 +0000 (15:27 -0700)
A local variable of tx_q worked around name collision with internal
txq variable in netif_subqueue macros.
This workaround is no longer needed.

Signed-off-by: Gur Stavi <gur.stavi@huawei.com>
Link: https://patch.msgid.link/6376db2a39b8d3bf2fa893f58f56246bed128d5d.1749038081.git.gur.stavi@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/huawei/hinic3/hinic3_tx.c

index 7b6f101da31395b8db36426aa83a50a3ff1b2618..3f7f73430be4113ae9d0cc6c45975f306a2dde8f 100644 (file)
@@ -482,7 +482,6 @@ static netdev_tx_t hinic3_send_one_skb(struct sk_buff *skb,
 {
        struct hinic3_sq_wqe_combo wqe_combo = {};
        struct hinic3_tx_info *tx_info;
-       struct hinic3_txq *tx_q = txq;
        u32 offload, queue_info = 0;
        struct hinic3_sq_task task;
        u16 wqebb_cnt, num_sge;
@@ -506,9 +505,9 @@ static netdev_tx_t hinic3_send_one_skb(struct sk_buff *skb,
                if (likely(wqebb_cnt > txq->tx_stop_thrs))
                        txq->tx_stop_thrs = min(wqebb_cnt, txq->tx_start_thrs);
 
-               netif_subqueue_try_stop(netdev, tx_q->sq->q_id,
-                                       hinic3_wq_free_wqebbs(&tx_q->sq->wq),
-                                       tx_q->tx_start_thrs);
+               netif_subqueue_try_stop(netdev, txq->sq->q_id,
+                                       hinic3_wq_free_wqebbs(&txq->sq->wq),
+                                       txq->tx_start_thrs);
 
                return NETDEV_TX_BUSY;
        }
@@ -543,10 +542,10 @@ static netdev_tx_t hinic3_send_one_skb(struct sk_buff *skb,
        }
 
        netif_subqueue_sent(netdev, txq->sq->q_id, skb->len);
-       netif_subqueue_maybe_stop(netdev, tx_q->sq->q_id,
-                                 hinic3_wq_free_wqebbs(&tx_q->sq->wq),
-                                 tx_q->tx_stop_thrs,
-                                 tx_q->tx_start_thrs);
+       netif_subqueue_maybe_stop(netdev, txq->sq->q_id,
+                                 hinic3_wq_free_wqebbs(&txq->sq->wq),
+                                 txq->tx_stop_thrs,
+                                 txq->tx_start_thrs);
 
        hinic3_prepare_sq_ctrl(&wqe_combo, queue_info, num_sge, owner);
        hinic3_write_db(txq->sq, 0, DB_CFLAG_DP_SQ,
@@ -630,7 +629,6 @@ bool hinic3_tx_poll(struct hinic3_txq *txq, int budget)
        struct net_device *netdev = txq->netdev;
        u16 hw_ci, sw_ci, q_id = txq->sq->q_id;
        struct hinic3_tx_info *tx_info;
-       struct hinic3_txq *tx_q = txq;
        unsigned int bytes_compl = 0;
        unsigned int pkts = 0;
        u16 wqebb_cnt = 0;
@@ -662,8 +660,8 @@ bool hinic3_tx_poll(struct hinic3_txq *txq, int budget)
        hinic3_wq_put_wqebbs(&txq->sq->wq, wqebb_cnt);
 
        netif_subqueue_completed_wake(netdev, q_id, pkts, bytes_compl,
-                                     hinic3_wq_free_wqebbs(&tx_q->sq->wq),
-                                     tx_q->tx_start_thrs);
+                                     hinic3_wq_free_wqebbs(&txq->sq->wq),
+                                     txq->tx_start_thrs);
 
        return pkts == HINIC3_TX_POLL_WEIGHT;
 }