tree-wide: fix comment/printk typos
[linux-flexiantxendom0-natty.git] / drivers / net / wireless / prism54 / islpci_eth.c
index ef3ef45..d44f8e2 100644 (file)
@@ -17,6 +17,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/gfp.h>
 
 #include <linux/pci.h>
 #include <linux/delay.h>
@@ -50,7 +51,7 @@ islpci_eth_cleanup_transmit(islpci_private *priv,
 
                /* check for holes in the arrays caused by multi fragment frames
                 * searching for the last fragment of a frame */
-               if (priv->pci_map_tx_address[index] != (dma_addr_t) NULL) {
+               if (priv->pci_map_tx_address[index]) {
                        /* entry is the last fragment of a frame
                         * free the skb structure and unmap pci memory */
                        skb = priv->data_low_tx[index];
@@ -72,7 +73,7 @@ islpci_eth_cleanup_transmit(islpci_private *priv,
        }
 }
 
-int
+netdev_tx_t
 islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
 {
        islpci_private *priv = netdev_priv(ndev);
@@ -87,10 +88,9 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
        unsigned long flags;
        unsigned char wds_mac[6];
        u32 curr_frag;
-       int err = 0;
 
 #if VERBOSE > SHOW_ERROR_MESSAGES
-       DEBUG(SHOW_FUNCTION_CALLS, "islpci_eth_transmit \n");
+       DEBUG(SHOW_FUNCTION_CALLS, "islpci_eth_transmit\n");
 #endif
 
        /* lock the driver code */
@@ -107,8 +107,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
                isl38xx_w32_flush(priv->device_base, ISL38XX_DEV_INT_UPDATE,
                                  ISL38XX_DEV_INT_REG);
                udelay(ISL38XX_WRITEIO_DELAY);
-
-               err = -EBUSY;
                goto drop_free;
        }
        /* Check alignment and WDS frame formatting. The start of the packet should
@@ -143,7 +141,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
                        }
 
 #if VERBOSE > SHOW_ERROR_MESSAGES
-                       DEBUG(SHOW_TRACING, "memmove %p %p %i \n", skb->data,
+                       DEBUG(SHOW_TRACING, "memmove %p %p %i\n", skb->data,
                              src, skb->len);
 #endif
                } else {
@@ -152,7 +150,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
                        if (unlikely(newskb == NULL)) {
                                printk(KERN_ERR "%s: Cannot allocate skb\n",
                                       ndev->name);
-                               err = -ENOMEM;
                                goto drop_free;
                        }
                        newskb_offset = (4 - (long) newskb->data) & 0x03;
@@ -197,8 +194,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
        if (unlikely(pci_map_address == 0)) {
                printk(KERN_WARNING "%s: cannot map buffer to PCI\n",
                       ndev->name);
-
-               err = -EIO;
                goto drop_free;
        }
        /* Place the fragment in the control block structure. */
@@ -229,8 +224,6 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
                priv->data_low_tx_full = 1;
        }
 
-       /* set the transmission time */
-       ndev->trans_start = jiffies;
        ndev->stats.tx_packets++;
        ndev->stats.tx_bytes += skb->len;
 
@@ -240,13 +233,13 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
        /* unlock the driver code */
        spin_unlock_irqrestore(&priv->slock, flags);
 
-       return 0;
+       return NETDEV_TX_OK;
 
       drop_free:
        ndev->stats.tx_dropped++;
        spin_unlock_irqrestore(&priv->slock, flags);
        dev_kfree_skb(skb);
-       return err;
+       return NETDEV_TX_OK;
 }
 
 static inline int
@@ -325,7 +318,7 @@ islpci_eth_receive(islpci_private *priv)
        int discard = 0;
 
 #if VERBOSE > SHOW_ERROR_MESSAGES
-       DEBUG(SHOW_FUNCTION_CALLS, "islpci_eth_receive \n");
+       DEBUG(SHOW_FUNCTION_CALLS, "islpci_eth_receive\n");
 #endif
 
        /* the device has written an Ethernet frame in the data area
@@ -437,7 +430,7 @@ islpci_eth_receive(islpci_private *priv)
                skb = dev_alloc_skb(MAX_FRAGMENT_SIZE_RX + 2);
                if (unlikely(skb == NULL)) {
                        /* error allocating an sk_buff structure elements */
-                       DEBUG(SHOW_ERROR_MESSAGES, "Error allocating skb \n");
+                       DEBUG(SHOW_ERROR_MESSAGES, "Error allocating skb\n");
                        break;
                }
                skb_reserve(skb, (4 - (long) skb->data) & 0x03);
@@ -456,8 +449,8 @@ islpci_eth_receive(islpci_private *priv)
                    pci_map_single(priv->pdev, (void *) skb->data,
                                   MAX_FRAGMENT_SIZE_RX + 2,
                                   PCI_DMA_FROMDEVICE);
-               if (unlikely(priv->pci_map_rx_address[index] == (dma_addr_t) NULL)) {
-                       /* error mapping the buffer to device accessable memory address */
+               if (unlikely(!priv->pci_map_rx_address[index])) {
+                       /* error mapping the buffer to device accessible memory address */
                        DEBUG(SHOW_ERROR_MESSAGES,
                              "Error mapping DMA address\n");