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>
This commit is contained in:
Florian Fainelli 2010-04-06 22:09:06 +00:00 committed by David S. Miller
parent eb0496308f
commit 2cc3c6b1bc
2 changed files with 23 additions and 24 deletions

View File

@ -298,7 +298,7 @@ au1000_adjust_link(struct net_device *dev)
spin_lock_irqsave(&aup->lock, flags); spin_lock_irqsave(&aup->lock, flags);
if (phydev->link && (aup->old_speed != phydev->speed)) { if (phydev->link && (aup->old_speed != phydev->speed)) {
// speed changed /* speed changed */
switch (phydev->speed) { switch (phydev->speed) {
case SPEED_10: case SPEED_10:
@ -317,7 +317,7 @@ au1000_adjust_link(struct net_device *dev)
} }
if (phydev->link && (aup->old_duplex != phydev->duplex)) { if (phydev->link && (aup->old_duplex != phydev->duplex)) {
// duplex mode changed /* duplex mode changed */
/* switching duplex mode requires to disable rx and tx! */ /* switching duplex mode requires to disable rx and tx! */
au1000_hard_stop(dev); au1000_hard_stop(dev);
@ -339,7 +339,7 @@ au1000_adjust_link(struct net_device *dev)
} }
if (phydev->link != aup->old_link) { if (phydev->link != aup->old_link) {
// link state changed /* link state changed */
if (!phydev->link) { if (!phydev->link) {
/* link went down */ /* link went down */
@ -668,8 +668,7 @@ static inline void au1000_update_rx_stats(struct net_device *dev, u32 status)
ps->rx_crc_errors++; ps->rx_crc_errors++;
if (status & RX_COLL) if (status & RX_COLL)
ps->collisions++; ps->collisions++;
} } else
else
ps->rx_bytes += status & RX_FRAME_LEN_MASK; ps->rx_bytes += status & RX_FRAME_LEN_MASK;
} }
@ -714,8 +713,7 @@ static int au1000_rx(struct net_device *dev)
skb_put(skb, frmlen); skb_put(skb, frmlen);
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb); /* pass the packet to upper layers */ netif_rx(skb); /* pass the packet to upper layers */
} } else {
else {
if (au1000_debug > 4) { if (au1000_debug > 4) {
if (status & RX_MISSED_FRAME) if (status & RX_MISSED_FRAME)
printk("rx miss\n"); printk("rx miss\n");
@ -761,8 +759,7 @@ static void au1000_update_tx_stats(struct net_device *dev, u32 status)
ps->tx_errors++; ps->tx_errors++;
ps->tx_aborted_errors++; ps->tx_aborted_errors++;
} }
} } else {
else {
ps->tx_errors++; ps->tx_errors++;
ps->tx_aborted_errors++; ps->tx_aborted_errors++;
if (status & (TX_NO_CARRIER | TX_LOSS_CARRIER)) if (status & (TX_NO_CARRIER | TX_LOSS_CARRIER))
@ -821,14 +818,16 @@ static int au1000_open(struct net_device *dev)
if (au1000_debug > 4) if (au1000_debug > 4)
printk("%s: open: dev=%p\n", dev->name, dev); printk("%s: open: dev=%p\n", dev->name, dev);
if ((retval = request_irq(dev->irq, au1000_interrupt, 0, retval = request_irq(dev->irq, au1000_interrupt, 0,
dev->name, dev))) { dev->name, dev);
if (retval) {
printk(KERN_ERR "%s: unable to get IRQ %d\n", printk(KERN_ERR "%s: unable to get IRQ %d\n",
dev->name, dev->irq); dev->name, dev->irq);
return retval; return retval;
} }
if ((retval = au1000_init(dev))) { retval = au1000_init(dev);
if (retval) {
printk(KERN_ERR "%s: error in au1000_init\n", dev->name); printk(KERN_ERR "%s: error in au1000_init\n", dev->name);
free_irq(dev->irq, dev); free_irq(dev->irq, dev);
return retval; return retval;
@ -897,8 +896,7 @@ static netdev_tx_t au1000_tx(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev); netif_stop_queue(dev);
aup->tx_full = 1; aup->tx_full = 1;
return NETDEV_TX_BUSY; return NETDEV_TX_BUSY;
} } else if (buff_stat & TX_T_DONE) {
else if (buff_stat & TX_T_DONE) {
au1000_update_tx_stats(dev, ptxd->status); au1000_update_tx_stats(dev, ptxd->status);
ptxd->len = 0; ptxd->len = 0;
} }
@ -915,8 +913,7 @@ static netdev_tx_t au1000_tx(struct sk_buff *skb, struct net_device *dev)
((char *)pDB->vaddr)[i] = 0; ((char *)pDB->vaddr)[i] = 0;
} }
ptxd->len = ETH_ZLEN; ptxd->len = ETH_ZLEN;
} } else
else
ptxd->len = skb->len; ptxd->len = skb->len;
ps->tx_packets++; ps->tx_packets++;
@ -976,9 +973,11 @@ static int au1000_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{ {
struct au1000_private *aup = netdev_priv(dev); struct au1000_private *aup = netdev_priv(dev);
if (!netif_running(dev)) return -EINVAL; if (!netif_running(dev))
return -EINVAL;
if (!aup->phy_dev) return -EINVAL; // PHY not controllable if (!aup->phy_dev)
return -EINVAL; /* PHY not controllable */
return phy_mii_ioctl(aup->phy_dev, if_mii(rq), cmd); return phy_mii_ioctl(aup->phy_dev, if_mii(rq), cmd);
} }
@ -997,7 +996,7 @@ static const struct net_device_ops au1000_netdev_ops = {
static int __devinit au1000_probe(struct platform_device *pdev) static int __devinit au1000_probe(struct platform_device *pdev)
{ {
static unsigned version_printed = 0; static unsigned version_printed;
struct au1000_private *aup = NULL; struct au1000_private *aup = NULL;
struct au1000_eth_platform_data *pd; struct au1000_eth_platform_data *pd;
struct net_device *dev = NULL; struct net_device *dev = NULL;

View File

@ -35,7 +35,7 @@
#define NUM_TX_BUFFS 4 #define NUM_TX_BUFFS 4
#define MAX_BUF_SIZE 2048 #define MAX_BUF_SIZE 2048
#define ETH_TX_TIMEOUT HZ/4 #define ETH_TX_TIMEOUT (HZ/4)
#define MAC_MIN_PKT_SIZE 64 #define MAC_MIN_PKT_SIZE 64
#define MULTICAST_FILTER_LIMIT 64 #define MULTICAST_FILTER_LIMIT 64