drivers/net: Use kcalloc or kzalloc
[safe/jmp/linux-2.6] / drivers / net / via-rhine.c
index 85df7ac..4930f9d 100644 (file)
@@ -89,7 +89,6 @@ static const int multicast_filter_limit = 32;
 #include <linux/timer.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
-#include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/dma-mapping.h>
@@ -1210,7 +1209,7 @@ static void rhine_reset_task(struct work_struct *work)
        spin_unlock_bh(&rp->lock);
        enable_irq(rp->pdev->irq);
 
-       dev->trans_start = jiffies;
+       dev->trans_start = jiffies; /* prevent tx timeout */
        dev->stats.tx_errors++;
        netif_wake_queue(dev);
 }
@@ -1295,8 +1294,6 @@ static netdev_tx_t rhine_start_tx(struct sk_buff *skb,
        if (rp->cur_tx == rp->dirty_tx + TX_QUEUE_LEN)
                netif_stop_queue(dev);
 
-       dev->trans_start = jiffies;
-
        spin_unlock_irqrestore(&rp->lock, flags);
 
        if (debug > 4) {
@@ -1704,13 +1701,11 @@ static void rhine_set_rx_mode(struct net_device *dev)
                iowrite32(0xffffffff, ioaddr + MulticastFilter1);
                rx_mode = 0x0C;
        } else {
-               struct dev_mc_list *mclist;
-               int i;
+               struct netdev_hw_addr *ha;
+
                memset(mc_filter, 0, sizeof(mc_filter));
-               for (i = 0, mclist = dev->mc_list;
-                    mclist && i < netdev_mc_count(dev);
-                    i++, mclist = mclist->next) {
-                       int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
+               netdev_for_each_mc_addr(ha, dev) {
+                       int bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
 
                        mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
                }