diff mbox series

[v2,06/50] wilc1000: move tx packet drop code into its own function

Message ID 20211223011358.4031459-7-davidm@egauge.net (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series wilc1000: rework tx path to use sk_buffs throughout | expand

Commit Message

David Mosberger-Tang Dec. 23, 2021, 1:14 a.m. UTC
This is just to improve code clarity.

Signed-off-by: David Mosberger-Tang <davidm@egauge.net>
---
 drivers/net/wireless/microchip/wilc1000/wlan.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c
index 7b7ee6ee9f849..e4342631aae93 100644
--- a/drivers/net/wireless/microchip/wilc1000/wlan.c
+++ b/drivers/net/wireless/microchip/wilc1000/wlan.c
@@ -200,6 +200,14 @@  static void wilc_wlan_tx_packet_done(struct txq_entry_t *tqe, int status)
 	kfree(tqe);
 }
 
+static void wilc_wlan_txq_drop_net_pkt(struct txq_entry_t *tqe)
+{
+	struct wilc *wilc = tqe->vif->wilc;
+
+	wilc_wlan_txq_remove(wilc, tqe->q_num, tqe);
+	wilc_wlan_tx_packet_done(tqe, 1);
+}
+
 static void wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
 {
 	struct wilc_vif *vif = netdev_priv(dev);
@@ -228,10 +236,8 @@  static void wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
 			struct txq_entry_t *tqe;
 
 			tqe = f->pending_acks[i].txqe;
-			if (tqe) {
-				wilc_wlan_txq_remove(wilc, tqe->q_num, tqe);
-				wilc_wlan_tx_packet_done(tqe, 1);
-			}
+			if (tqe)
+				wilc_wlan_txq_drop_net_pkt(tqe);
 		}
 	}
 	f->pending_acks_idx = 0;