aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/au1000_eth.c
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2010-04-06 18:09:06 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-07 05:07:49 -0400
commit2cc3c6b1bc2d68ddb003a94f7313999f7984735f (patch)
treeac4b09a37bc388062e7da1c94981324cff1f8382 /drivers/net/au1000_eth.c
parenteb0496308f22093d5b3ce6c9d591233047f41d39 (diff)
au1000-eth: fix checkpatch errors.
This patch fixes multiple errors reported by checkpatch: - else not on the ending brace of an if { } - multiple occurences of for( instead of for ( - c99 comments - assignment and tests on the same line - test and statements on the same line - macro with complex value not between parenthesis - static variable with initialization value No functionnal change. Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/au1000_eth.c')
-rw-r--r--drivers/net/au1000_eth.c45
1 files changed, 22 insertions, 23 deletions
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index 7d40177de399..49f56b4654f6 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -298,9 +298,9 @@ au1000_adjust_link(struct net_device *dev)
298 spin_lock_irqsave(&aup->lock, flags); 298 spin_lock_irqsave(&aup->lock, flags);
299 299
300 if (phydev->link && (aup->old_speed != phydev->speed)) { 300 if (phydev->link && (aup->old_speed != phydev->speed)) {
301 // speed changed 301 /* speed changed */
302 302
303 switch(phydev->speed) { 303 switch (phydev->speed) {
304 case SPEED_10: 304 case SPEED_10:
305 case SPEED_100: 305 case SPEED_100:
306 break; 306 break;
@@ -317,7 +317,7 @@ au1000_adjust_link(struct net_device *dev)
317 } 317 }
318 318
319 if (phydev->link && (aup->old_duplex != phydev->duplex)) { 319 if (phydev->link && (aup->old_duplex != phydev->duplex)) {
320 // duplex mode changed 320 /* duplex mode changed */
321 321
322 /* switching duplex mode requires to disable rx and tx! */ 322 /* switching duplex mode requires to disable rx and tx! */
323 au1000_hard_stop(dev); 323 au1000_hard_stop(dev);
@@ -338,8 +338,8 @@ au1000_adjust_link(struct net_device *dev)
338 status_change = 1; 338 status_change = 1;
339 } 339 }
340 340
341 if(phydev->link != aup->old_link) { 341 if (phydev->link != aup->old_link) {
342 // link state changed 342 /* link state changed */
343 343
344 if (!phydev->link) { 344 if (!phydev->link) {
345 /* link went down */ 345 /* link went down */
@@ -668,8 +668,7 @@ static inline void au1000_update_rx_stats(struct net_device *dev, u32 status)
668 ps->rx_crc_errors++; 668 ps->rx_crc_errors++;
669 if (status & RX_COLL) 669 if (status & RX_COLL)
670 ps->collisions++; 670 ps->collisions++;
671 } 671 } else
672 else
673 ps->rx_bytes += status & RX_FRAME_LEN_MASK; 672 ps->rx_bytes += status & RX_FRAME_LEN_MASK;
674 673
675} 674}
@@ -714,8 +713,7 @@ static int au1000_rx(struct net_device *dev)
714 skb_put(skb, frmlen); 713 skb_put(skb, frmlen);
715 skb->protocol = eth_type_trans(skb, dev); 714 skb->protocol = eth_type_trans(skb, dev);
716 netif_rx(skb); /* pass the packet to upper layers */ 715 netif_rx(skb); /* pass the packet to upper layers */
717 } 716 } else {
718 else {
719 if (au1000_debug > 4) { 717 if (au1000_debug > 4) {
720 if (status & RX_MISSED_FRAME) 718 if (status & RX_MISSED_FRAME)
721 printk("rx miss\n"); 719 printk("rx miss\n");
@@ -761,8 +759,7 @@ static void au1000_update_tx_stats(struct net_device *dev, u32 status)
761 ps->tx_errors++; 759 ps->tx_errors++;
762 ps->tx_aborted_errors++; 760 ps->tx_aborted_errors++;
763 } 761 }
764 } 762 } else {
765 else {
766 ps->tx_errors++; 763 ps->tx_errors++;
767 ps->tx_aborted_errors++; 764 ps->tx_aborted_errors++;
768 if (status & (TX_NO_CARRIER | TX_LOSS_CARRIER)) 765 if (status & (TX_NO_CARRIER | TX_LOSS_CARRIER))
@@ -821,14 +818,16 @@ static int au1000_open(struct net_device *dev)
821 if (au1000_debug > 4) 818 if (au1000_debug > 4)
822 printk("%s: open: dev=%p\n", dev->name, dev); 819 printk("%s: open: dev=%p\n", dev->name, dev);
823 820
824 if ((retval = request_irq(dev->irq, au1000_interrupt, 0, 821 retval = request_irq(dev->irq, au1000_interrupt, 0,
825 dev->name, dev))) { 822 dev->name, dev);
823 if (retval) {
826 printk(KERN_ERR "%s: unable to get IRQ %d\n", 824 printk(KERN_ERR "%s: unable to get IRQ %d\n",
827 dev->name, dev->irq); 825 dev->name, dev->irq);
828 return retval; 826 return retval;
829 } 827 }
830 828
831 if ((retval = au1000_init(dev))) { 829 retval = au1000_init(dev);
830 if (retval) {
832 printk(KERN_ERR "%s: error in au1000_init\n", dev->name); 831 printk(KERN_ERR "%s: error in au1000_init\n", dev->name);
833 free_irq(dev->irq, dev); 832 free_irq(dev->irq, dev);
834 return retval; 833 return retval;
@@ -897,8 +896,7 @@ static netdev_tx_t au1000_tx(struct sk_buff *skb, struct net_device *dev)
897 netif_stop_queue(dev); 896 netif_stop_queue(dev);
898 aup->tx_full = 1; 897 aup->tx_full = 1;
899 return NETDEV_TX_BUSY; 898 return NETDEV_TX_BUSY;
900 } 899 } else if (buff_stat & TX_T_DONE) {
901 else if (buff_stat & TX_T_DONE) {
902 au1000_update_tx_stats(dev, ptxd->status); 900 au1000_update_tx_stats(dev, ptxd->status);
903 ptxd->len = 0; 901 ptxd->len = 0;
904 } 902 }
@@ -911,12 +909,11 @@ static netdev_tx_t au1000_tx(struct sk_buff *skb, struct net_device *dev)
911 pDB = aup->tx_db_inuse[aup->tx_head]; 909 pDB = aup->tx_db_inuse[aup->tx_head];
912 skb_copy_from_linear_data(skb, (void *)pDB->vaddr, skb->len); 910 skb_copy_from_linear_data(skb, (void *)pDB->vaddr, skb->len);
913 if (skb->len < ETH_ZLEN) { 911 if (skb->len < ETH_ZLEN) {
914 for (i=skb->len; i<ETH_ZLEN; i++) { 912 for (i = skb->len; i < ETH_ZLEN; i++) {
915 ((char *)pDB->vaddr)[i] = 0; 913 ((char *)pDB->vaddr)[i] = 0;
916 } 914 }
917 ptxd->len = ETH_ZLEN; 915 ptxd->len = ETH_ZLEN;
918 } 916 } else
919 else
920 ptxd->len = skb->len; 917 ptxd->len = skb->len;
921 918
922 ps->tx_packets++; 919 ps->tx_packets++;
@@ -976,9 +973,11 @@ static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
976{ 973{
977 struct au1000_private *aup = netdev_priv(dev); 974 struct au1000_private *aup = netdev_priv(dev);
978 975
979 if (!netif_running(dev)) return -EINVAL; 976 if (!netif_running(dev))
977 return -EINVAL;
980 978
981 if (!aup->phy_dev) return -EINVAL; // PHY not controllable 979 if (!aup->phy_dev)
980 return -EINVAL; /* PHY not controllable */
982 981
983 return phy_mii_ioctl(aup->phy_dev, if_mii(rq), cmd); 982 return phy_mii_ioctl(aup->phy_dev, if_mii(rq), cmd);
984} 983}
@@ -997,7 +996,7 @@ static const struct net_device_ops au1000_netdev_ops = {
997 996
998static int __devinit au1000_probe(struct platform_device *pdev) 997static int __devinit au1000_probe(struct platform_device *pdev)
999{ 998{
1000 static unsigned version_printed = 0; 999 static unsigned version_printed;
1001 struct au1000_private *aup = NULL; 1000 struct au1000_private *aup = NULL;
1002 struct au1000_eth_platform_data *pd; 1001 struct au1000_eth_platform_data *pd;
1003 struct net_device *dev = NULL; 1002 struct net_device *dev = NULL;
@@ -1140,7 +1139,7 @@ static int __devinit au1000_probe(struct platform_device *pdev)
1140 if (aup->mii_bus->irq == NULL) 1139 if (aup->mii_bus->irq == NULL)
1141 goto err_out; 1140 goto err_out;
1142 1141
1143 for(i = 0; i < PHY_MAX_ADDR; ++i) 1142 for (i = 0; i < PHY_MAX_ADDR; ++i)
1144 aup->mii_bus->irq[i] = PHY_POLL; 1143 aup->mii_bus->irq[i] = PHY_POLL;
1145 /* if known, set corresponding PHY IRQs */ 1144 /* if known, set corresponding PHY IRQs */
1146 if (aup->phy_static_config) 1145 if (aup->phy_static_config)