]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: eepro100: Replace purge_tx_ring() with memset()
authorMarek Vasut <marek.vasut+renesas@gmail.com>
Sat, 23 May 2020 12:26:16 +0000 (14:26 +0200)
committerMarek Vasut <marek.vasut+renesas@gmail.com>
Thu, 18 Jun 2020 17:34:40 +0000 (19:34 +0200)
This function zeroes-out all the descriptors in the TX ring,
use memset() instead.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
drivers/net/eepro100.c

index 5d11665fdc8f287e38027016e558940db95b40fd..6fb9192e81ef7d440fd46e2a9331a6f49262f5ea 100644 (file)
@@ -767,23 +767,9 @@ static void init_rx_ring(struct eth_device *dev)
 
 static void purge_tx_ring(struct eth_device *dev)
 {
-       int i;
-
        tx_next = 0;
        tx_threshold = 0x01208000;
-
-       for (i = 0; i < NUM_TX_DESC; i++) {
-               tx_ring[i].status = 0;
-               tx_ring[i].command = 0;
-               tx_ring[i].link = 0;
-               tx_ring[i].tx_desc_addr = 0;
-               tx_ring[i].count = 0;
-
-               tx_ring[i].tx_buf_addr0 = 0;
-               tx_ring[i].tx_buf_size0 = 0;
-               tx_ring[i].tx_buf_addr1 = 0;
-               tx_ring[i].tx_buf_size1 = 0;
-       }
+       memset(tx_ring, 0, sizeof(*tx_ring) * NUM_TX_DESC);
 }
 
 static void read_hw_addr(struct eth_device *dev, bd_t *bis)