[PARISC] fix lasi_82596 build
[sfrench/cifs-2.6.git] / drivers / net / lasi_82596.c
index ea392f2a5aa26aeb9c9f7670fbb6303e2c9c1672..741780e14b2cc64f026a56dfcaf7c6e4085529ba 100644 (file)
@@ -81,9 +81,9 @@
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 #include <linux/init.h>
-#include <linux/pci.h>
 #include <linux/types.h>
 #include <linux/bitops.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/pgtable.h>
@@ -384,7 +384,7 @@ struct i596_private {
        struct device *dev;
 };
 
-static char init_setup[] =
+static const char init_setup[] =
 {
        0x8E,                   /* length, prefetch on */
        0xC8,                   /* fifo to 8, monitor off */
@@ -683,7 +683,7 @@ static int init_i596_mem(struct net_device *dev)
        enable_irq(dev->irq);   /* enable IRQs from LAN */
 
        DEB(DEB_INIT, printk("%s: queuing CmdConfigure\n", dev->name));
-       memcpy(lp->cf_cmd.i596_config, init_setup, 14);
+       memcpy(lp->cf_cmd.i596_config, init_setup, sizeof(init_setup));
        lp->cf_cmd.cmd.command = CmdConfigure;
        CHECK_WBACK(lp, &(lp->cf_cmd), sizeof(struct cf_cmd));
        i596_add_cmd(dev, &lp->cf_cmd.cmd);
@@ -801,7 +801,6 @@ memory_squeeze:
                                lp->stats.rx_dropped++;
                        }
                        else {
-                               skb->dev = dev;
                                if (!rx_in_place) {
                                        /* 16 byte align the data fields */
                                        dma_sync_single_for_cpu(lp->dev, (dma_addr_t)WSWAPchar(rbd->b_data), PKT_BUF_SZ, DMA_FROM_DEVICE);
@@ -1156,32 +1155,12 @@ static int __devinit i82596_probe(struct net_device *dev,
        dma_addr_t dma_addr;
 
        /* This lot is ensure things have been cache line aligned. */
-       if (sizeof(struct i596_rfd) != 32) {
-           printk("82596: sizeof(struct i596_rfd) = %d\n",
-                           (int)sizeof(struct i596_rfd));
-           return -ENODEV;
-       }
-       if ((sizeof(struct i596_rbd) % 32) != 0) {
-           printk("82596: sizeof(struct i596_rbd) = %d\n",
-                           (int)sizeof(struct i596_rbd));
-           return -ENODEV;
-       }
-       if ((sizeof(struct tx_cmd) % 32) != 0) {
-           printk("82596: sizeof(struct tx_cmd) = %d\n",
-                           (int)sizeof(struct tx_cmd));
-           return -ENODEV;
-       }
-       if (sizeof(struct i596_tbd) != 32) {
-           printk("82596: sizeof(struct i596_tbd) = %d\n",
-                           (int)sizeof(struct i596_tbd));
-           return -ENODEV;
-       }
+       BUILD_BUG_ON(sizeof(struct i596_rfd) != 32);
+       BUILD_BUG_ON(sizeof(struct i596_rbd) &  31);
+       BUILD_BUG_ON(sizeof(struct tx_cmd)   &  31);
+       BUILD_BUG_ON(sizeof(struct i596_tbd) != 32);
 #ifndef __LP64__
-       if (sizeof(struct i596_private) > 4096) {
-           printk("82596: sizeof(struct i596_private) = %d\n",
-                           (int)sizeof(struct i596_private));
-           return -ENODEV;
-       }
+       BUILD_BUG_ON(sizeof(struct i596_private) > 4096);
 #endif
 
        if (!dev->base_addr || !dev->irq)