]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/3c59x.c
zd1211rw: fix sparse warnings
[linux-2.6-omap-h63xx.git] / drivers / net / 3c59x.c
index 93eb78425d6dd460c6bb9a4761d5eefce262c678..6f8e7d4cf74dbdd224fdbd4d7d1b5924c206ade0 100644 (file)
@@ -538,10 +538,10 @@ enum MasterCtrl {
 #define LAST_FRAG      0x80000000                      /* Last Addr/Len pair in descriptor. */
 #define DN_COMPLETE    0x00010000                      /* This packet has been downloaded */
 struct boom_rx_desc {
-       u32 next;                                       /* Last entry points to 0.   */
-       s32 status;
-       u32 addr;                                       /* Up to 63 addr/len pairs possible. */
-       s32 length;                                     /* Set LAST_FRAG to indicate last pair. */
+       __le32 next;                                    /* Last entry points to 0.   */
+       __le32 status;
+       __le32 addr;                                    /* Up to 63 addr/len pairs possible. */
+       __le32 length;                                  /* Set LAST_FRAG to indicate last pair. */
 };
 /* Values for the Rx status entry. */
 enum rx_desc_status {
@@ -558,16 +558,16 @@ enum rx_desc_status {
 #endif
 
 struct boom_tx_desc {
-       u32 next;                                       /* Last entry points to 0.   */
-       s32 status;                                     /* bits 0:12 length, others see below.  */
+       __le32 next;                                    /* Last entry points to 0.   */
+       __le32 status;                                  /* bits 0:12 length, others see below.  */
 #if DO_ZEROCOPY
        struct {
-               u32 addr;
-               s32 length;
+               __le32 addr;
+               __le32 length;
        } frag[1+MAX_SKB_FRAGS];
 #else
-               u32 addr;
-               s32 length;
+               __le32 addr;
+               __le32 length;
 #endif
 };
 
@@ -1131,7 +1131,7 @@ static int __devinit vortex_probe1(struct device *gendev,
                                           + sizeof(struct boom_tx_desc) * TX_RING_SIZE,
                                           &vp->rx_ring_dma);
        retval = -ENOMEM;
-       if (vp->rx_ring == 0)
+       if (!vp->rx_ring)
                goto free_region;
 
        vp->tx_ring = (struct boom_tx_desc *)(vp->rx_ring + RX_RING_SIZE);
@@ -1204,7 +1204,7 @@ static int __devinit vortex_probe1(struct device *gendev,
        if ((checksum != 0x00) && !(vci->drv_flags & IS_TORNADO))
                printk(" ***INVALID CHECKSUM %4.4x*** ", checksum);
        for (i = 0; i < 3; i++)
-               ((u16 *)dev->dev_addr)[i] = htons(eeprom[i + 10]);
+               ((__be16 *)dev->dev_addr)[i] = htons(eeprom[i + 10]);
        memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
        if (print_info)
                printk(" %s", print_mac(mac, dev->dev_addr));
@@ -1491,7 +1491,7 @@ vortex_up(struct net_device *dev)
        struct vortex_private *vp = netdev_priv(dev);
        void __iomem *ioaddr = vp->ioaddr;
        unsigned int config;
-       int i, mii_reg1, mii_reg5, err;
+       int i, mii_reg1, mii_reg5, err = 0;
 
        if (VORTEX_PCI(vp)) {
                pci_set_power_state(VORTEX_PCI(vp), PCI_D0);    /* Go active */
@@ -2500,7 +2500,7 @@ boomerang_rx(struct net_device *dev)
 
                        /* Check if the packet is long enough to just accept without
                           copying to a properly sized skbuff. */
-                       if (pkt_len < rx_copybreak && (skb = dev_alloc_skb(pkt_len + 2)) != 0) {
+                       if (pkt_len < rx_copybreak && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
                                skb_reserve(skb, 2);    /* Align IP on 16 byte boundaries */
                                pci_dma_sync_single_for_cpu(VORTEX_PCI(vp), dma, PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
                                /* 'skb_put()' points to the start of sk_buff data area. */
@@ -2914,7 +2914,7 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
        struct vortex_private *vp = netdev_priv(dev);
        void __iomem *ioaddr = vp->ioaddr;
        unsigned long flags;
-       int state = 0;
+       pci_power_t state = 0;
 
        if(VORTEX_PCI(vp))
                state = VORTEX_PCI(vp)->current_state;
@@ -3118,7 +3118,13 @@ static void acpi_set_WOL(struct net_device *dev)
                iowrite16(SetRxFilter|RxStation|RxMulticast|RxBroadcast, ioaddr + EL3_CMD);
                iowrite16(RxEnable, ioaddr + EL3_CMD);
 
-               pci_enable_wake(VORTEX_PCI(vp), 0, 1);
+               if (pci_enable_wake(VORTEX_PCI(vp), PCI_D3hot, 1)) {
+                       printk(KERN_INFO "%s: WOL not supported.\n",
+                                       pci_name(VORTEX_PCI(vp)));
+
+                       vp->enable_wol = 0;
+                       return;
+               }
 
                /* Change the power state to D3; RxEnable doesn't take effect. */
                pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot);