Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / net / acenic.c
index 6eea3a8..b508812 100644 (file)
@@ -58,6 +58,7 @@
 #include <linux/errno.h>
 #include <linux/ioport.h>
 #include <linux/pci.h>
+#include <linux/dma-mapping.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
@@ -870,10 +871,8 @@ static void ace_init_cleanup(struct net_device *dev)
        if (ap->info)
                pci_free_consistent(ap->pdev, sizeof(struct ace_info),
                                    ap->info, ap->info_dma);
-       if (ap->skb)
-               kfree(ap->skb);
-       if (ap->trace_buf)
-               kfree(ap->trace_buf);
+       kfree(ap->skb);
+       kfree(ap->trace_buf);
 
        if (dev->irq)
                free_irq(dev->irq, dev);
@@ -1003,6 +1002,8 @@ static int __devinit ace_init(struct net_device *dev)
 
        mac1 = 0;
        for(i = 0; i < 4; i++) {
+               int tmp;
+
                mac1 = mac1 << 8;
                tmp = read_eeprom_byte(dev, 0x8c+i);
                if (tmp < 0) {
@@ -1013,6 +1014,8 @@ static int __devinit ace_init(struct net_device *dev)
        }
        mac2 = 0;
        for(i = 4; i < 8; i++) {
+               int tmp;
+
                mac2 = mac2 << 8;
                tmp = read_eeprom_byte(dev, 0x8c+i);
                if (tmp < 0) {
@@ -1167,9 +1170,9 @@ static int __devinit ace_init(struct net_device *dev)
        /*
         * Configure DMA attributes.
         */
-       if (!pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) {
+       if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
                ap->pci_using_dac = 1;
-       } else if (!pci_set_dma_mask(pdev, 0xffffffffULL)) {
+       } else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
                ap->pci_using_dac = 0;
        } else {
                ecode = -ENODEV;