whitespace
use pr_debug
don't use tmp for different types in a single function
don't shift and mask MAC address multiple times

Signed-off-by: Joe Perches <[EMAIL PROTECTED]>

diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c
index b508812..3f2fa86 100644
--- a/drivers/net/acenic.c
+++ b/drivers/net/acenic.c
@@ -461,7 +461,7 @@ static struct ethtool_ops ace_ethtool_op
 static void ace_watchdog(struct net_device *dev);
 
 static int __devinit acenic_probe_one(struct pci_dev *pdev,
-               const struct pci_device_id *id)
+                                     const struct pci_device_id *id)
 {
        struct net_device *dev;
        struct ace_private *ap;
@@ -687,7 +687,7 @@ static void __devexit acenic_remove_one(
                                dma_addr_t mapping;
 
                                ringp = &ap->skb->rx_mini_skbuff[i];
-                               mapping = pci_unmap_addr(ringp,mapping);
+                               mapping = pci_unmap_addr(ringp, mapping);
                                pci_unmap_page(ap->pdev, mapping,
                                               ACE_MINI_BUFSIZE,
                                               PCI_DMA_FROMDEVICE);
@@ -1001,37 +1001,29 @@ static int __devinit ace_init(struct net
        readl(&regs->ModeStat);         /* PCI write posting */
 
        mac1 = 0;
-       for(i = 0; i < 4; i++) {
-               int tmp;
-
-               mac1 = mac1 << 8;
-               tmp = read_eeprom_byte(dev, 0x8c+i);
-               if (tmp < 0) {
+       for (i = 0; i < 4; i++) {
+               int val = read_eeprom_byte(dev, 0x8c+i);
+               if (val < 0) {
                        ecode = -EIO;
                        goto init_error;
-               } else
-                       mac1 |= (tmp & 0xff);
+               }
+               mac1 <<= 8;
+               mac1 |= (val & 0xff);
        }
        mac2 = 0;
-       for(i = 4; i < 8; i++) {
-               int tmp;
-
-               mac2 = mac2 << 8;
-               tmp = read_eeprom_byte(dev, 0x8c+i);
-               if (tmp < 0) {
+       for (i = 4; i < 8; i++) {
+               int val = read_eeprom_byte(dev, 0x8c+i);
+               if (val < 0) {
                        ecode = -EIO;
                        goto init_error;
-               } else
-                       mac2 |= (tmp & 0xff);
+               }
+               mac2 <<= 8;
+               mac2 |= (val & 0xff);
        }
 
        writel(mac1, &regs->MacAddrHi);
        writel(mac2, &regs->MacAddrLo);
 
-       printk("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
-              (mac1 >> 8) & 0xff, mac1 & 0xff, (mac2 >> 24) &0xff,
-              (mac2 >> 16) & 0xff, (mac2 >> 8) & 0xff, mac2 & 0xff);
-
        dev->dev_addr[0] = (mac1 >> 8) & 0xff;
        dev->dev_addr[1] = mac1 & 0xff;
        dev->dev_addr[2] = (mac2 >> 24) & 0xff;
@@ -1039,6 +1031,11 @@ static int __devinit ace_init(struct net
        dev->dev_addr[4] = (mac2 >> 8) & 0xff;
        dev->dev_addr[5] = mac2 & 0xff;
 
+       printk(KERN_INFO "MAC: %02x:%02x:%02x:%02x:%02x:%02x\n",
+              dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
+              dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]);
+       
+
        /*
         * Looks like this is necessary to deal with on all architectures,
         * even this %$#%$# N440BX Intel based thing doesn't get it right.
@@ -1405,7 +1402,7 @@ static int __devinit ace_init(struct net
         */
        tmp = LNK_ENABLE | LNK_FULL_DUPLEX | LNK_1000MB | LNK_100MB |
                LNK_10MB | LNK_RX_FLOW_CTL_Y | LNK_NEG_FCTL | LNK_NEGOTIATE;
-       if(ap->version >= 2)
+       if (ap->version >= 2)
                tmp |= LNK_TX_FLOW_CTL_Y;
 
        /*
@@ -1621,9 +1618,7 @@ static void ace_tasklet(unsigned long de
        cur_size = atomic_read(&ap->cur_rx_bufs);
        if ((cur_size < RX_LOW_STD_THRES) &&
            !test_and_set_bit(0, &ap->std_refill_busy)) {
-#ifdef DEBUG
-               printk("refilling buffers (current %i)\n", cur_size);
-#endif
+               pr_debug("refilling buffers (current %i)\n", cur_size);
                ace_load_std_rx_ring(ap, RX_RING_SIZE - cur_size);
        }
 
@@ -1631,10 +1626,8 @@ static void ace_tasklet(unsigned long de
                cur_size = atomic_read(&ap->cur_mini_bufs);
                if ((cur_size < RX_LOW_MINI_THRES) &&
                    !test_and_set_bit(0, &ap->mini_refill_busy)) {
-#ifdef DEBUG
-                       printk("refilling mini buffers (current %i)\n",
-                              cur_size);
-#endif
+                       pr_debug("refilling mini buffers (current %i)\n",
+                                cur_size);
                        ace_load_mini_rx_ring(ap, RX_MINI_SIZE - cur_size);
                }
        }
@@ -1642,9 +1635,7 @@ static void ace_tasklet(unsigned long de
        cur_size = atomic_read(&ap->cur_jumbo_bufs);
        if (ap->jumbo && (cur_size < RX_LOW_JUMBO_THRES) &&
            !test_and_set_bit(0, &ap->jumbo_refill_busy)) {
-#ifdef DEBUG
-               printk("refilling jumbo buffers (current %i)\n", cur_size);
-#endif
+               pr_debug("refilling jumbo buffers (current %i)\n", cur_size);
                ace_load_jumbo_rx_ring(ap, RX_JUMBO_SIZE - cur_size);
        }
        ap->tasklet_pending = 0;
@@ -2229,9 +2220,7 @@ static irqreturn_t ace_interrupt(int irq
                if (cur_size < RX_LOW_STD_THRES) {
                        if ((cur_size < RX_PANIC_STD_THRES) &&
                            !test_and_set_bit(0, &ap->std_refill_busy)) {
-#ifdef DEBUG
-                               printk("low on std buffers %i\n", cur_size);
-#endif
+                               pr_debug("low on std buffers %i\n", cur_size);
                                ace_load_std_rx_ring(ap,
                                                     RX_RING_SIZE - cur_size);
                        } else
@@ -2244,10 +2233,8 @@ static irqreturn_t ace_interrupt(int irq
                                if ((cur_size < RX_PANIC_MINI_THRES) &&
                                    !test_and_set_bit(0,
                                                      &ap->mini_refill_busy)) {
-#ifdef DEBUG
-                                       printk("low on mini buffers %i\n",
-                                              cur_size);
-#endif
+                                       pr_debug("low on mini buffers %i\n",
+                                                cur_size);
                                        ace_load_mini_rx_ring(ap, RX_MINI_SIZE 
- cur_size);
                                } else
                                        run_tasklet = 1;
@@ -2260,10 +2247,8 @@ static irqreturn_t ace_interrupt(int irq
                                if ((cur_size < RX_PANIC_JUMBO_THRES) &&
                                    !test_and_set_bit(0,
                                                      &ap->jumbo_refill_busy)){
-#ifdef DEBUG
-                                       printk("low on jumbo buffers %i\n",
-                                              cur_size);
-#endif
+                                       pr_debug("low on jumbo buffers %i\n",
+                                                cur_size);
                                        ace_load_jumbo_rx_ring(ap, 
RX_JUMBO_SIZE - cur_size);
                                } else
                                        run_tasklet = 1;
@@ -2346,7 +2331,7 @@ static int ace_open(struct net_device *d
                ace_issue_cmd(regs, &cmd);
 
                ap->promisc = 1;
-       }else
+       } else
                ap->promisc = 0;
        ap->mcast_all = 0;
 
@@ -2816,10 +2801,10 @@ static int ace_set_mac_addr(struct net_d
        u8 *da;
        struct cmd cmd;
 
-       if(netif_running(dev))
+       if (netif_running(dev))
                return -EBUSY;
 
-       memcpy(dev->dev_addr, addr->sa_data,dev->addr_len);
+       memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
 
        da = (u8 *)dev->dev_addr;
 
@@ -2862,7 +2847,7 @@ static void ace_set_multicast_list(struc
                cmd.idx = 0;
                ace_issue_cmd(regs, &cmd);
                ap->promisc = 1;
-       }else if (!(dev->flags & IFF_PROMISC) && (ap->promisc)) {
+       } else if (!(dev->flags & IFF_PROMISC) && (ap->promisc)) {
                cmd.evt = C_SET_PROMISC_MODE;
                cmd.code = C_C_PROMISC_DISABLE;
                cmd.idx = 0;
@@ -2881,7 +2866,7 @@ static void ace_set_multicast_list(struc
                cmd.code = C_C_MCAST_ENABLE;
                cmd.idx = 0;
                ace_issue_cmd(regs, &cmd);
-       }else if (!ap->mcast_all) {
+       } else if (!ap->mcast_all) {
                cmd.evt = C_SET_MULTICAST_MODE;
                cmd.code = C_C_MCAST_DISABLE;
                cmd.idx = 0;
@@ -2993,13 +2978,13 @@ int __devinit ace_load_firmware(struct n
                         tigonFwRodataLen);
                ace_clear(regs, tigonFwBssAddr, tigonFwBssLen);
                ace_clear(regs, tigonFwSbssAddr, tigonFwSbssLen);
-       }else if (ap->version == 2) {
+       } else if (ap->version == 2) {
                ace_clear(regs, tigon2FwBssAddr, tigon2FwBssLen);
                ace_clear(regs, tigon2FwSbssAddr, tigon2FwSbssLen);
-               ace_copy(regs, tigon2FwText, tigon2FwTextAddr,tigon2FwTextLen);
+               ace_copy(regs, tigon2FwText, tigon2FwTextAddr, tigon2FwTextLen);
                ace_copy(regs, tigon2FwRodata, tigon2FwRodataAddr,
                         tigon2FwRodataLen);
-               ace_copy(regs, tigon2FwData, tigon2FwDataAddr,tigon2FwDataLen);
+               ace_copy(regs, tigon2FwData, tigon2FwDataAddr, tigon2FwDataLen);
        }
 
        return 0;
@@ -3151,7 +3136,7 @@ static void __devinit eeprom_stop(struct
  * Read a whole byte from the EEPROM.
  */
 static int __devinit read_eeprom_byte(struct net_device *dev,
-                                  unsigned long offset)
+                                     unsigned long offset)
 {
        struct ace_private *ap = netdev_priv(dev);
        struct ace_regs __iomem *regs = ap->regs;


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to