Skip to content

Commit

Permalink
drivers/net/sky2: Convert to use netif_printk macros
Browse files Browse the repository at this point in the history
Some unlikely(netif_msg_<foo>(sky2)) tests are also
removed by this change.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Joe Perches authored and David S. Miller committed Feb 16, 2010
1 parent 6909c66 commit 6c35aba
Showing 1 changed file with 27 additions and 38 deletions.
65 changes: 27 additions & 38 deletions drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1613,8 +1613,7 @@ static int sky2_up(struct net_device *dev)
sky2_write32(hw, B0_IMSK, imask);
sky2_read32(hw, B0_IMSK);

if (netif_msg_ifup(sky2))
printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
netif_info(sky2, ifup, dev, "enabling interface\n");

return 0;

Expand Down Expand Up @@ -1697,9 +1696,8 @@ static netdev_tx_t sky2_xmit_frame(struct sk_buff *skb,
goto mapping_error;

slot = sky2->tx_prod;
if (unlikely(netif_msg_tx_queued(sky2)))
printk(KERN_DEBUG "%s: tx queued, slot %u, len %d\n",
dev->name, slot, skb->len);
netif_printk(sky2, tx_queued, KERN_DEBUG, dev,
"tx queued, slot %u, len %d\n", slot, skb->len);

/* Send high bits if needed */
upper = upper_32_bits(mapping);
Expand Down Expand Up @@ -1864,9 +1862,8 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
sky2_tx_unmap(sky2->hw->pdev, re);

if (skb) {
if (unlikely(netif_msg_tx_done(sky2)))
printk(KERN_DEBUG "%s: tx done %u\n",
dev->name, idx);
netif_printk(sky2, tx_done, KERN_DEBUG, dev,
"tx done %u\n", idx);

dev->stats.tx_packets++;
dev->stats.tx_bytes += skb->len;
Expand Down Expand Up @@ -1961,8 +1958,7 @@ static int sky2_down(struct net_device *dev)
if (!sky2->tx_le)
return 0;

if (netif_msg_ifdown(sky2))
printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
netif_info(sky2, ifdown, dev, "disabling interface\n");

/* Disable port IRQ */
sky2_write32(hw, B0_IMSK,
Expand Down Expand Up @@ -2028,12 +2024,11 @@ static void sky2_link_up(struct sky2_port *sky2)
sky2_write8(hw, SK_REG(port, LNK_LED_REG),
LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF);

if (netif_msg_link(sky2))
printk(KERN_INFO PFX
"%s: Link is up at %d Mbps, %s duplex, flow control %s\n",
sky2->netdev->name, sky2->speed,
sky2->duplex == DUPLEX_FULL ? "full" : "half",
fc_name[sky2->flow_status]);
netif_info(sky2, link, sky2->netdev,
"Link is up at %d Mbps, %s duplex, flow control %s\n",
sky2->speed,
sky2->duplex == DUPLEX_FULL ? "full" : "half",
fc_name[sky2->flow_status]);
}

static void sky2_link_down(struct sky2_port *sky2)
Expand All @@ -2053,8 +2048,7 @@ static void sky2_link_down(struct sky2_port *sky2)
/* Turn off link LED */
sky2_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_OFF);

if (netif_msg_link(sky2))
printk(KERN_INFO PFX "%s: Link is down.\n", sky2->netdev->name);
netif_info(sky2, link, sky2->netdev, "Link is down\n");

sky2_phy_init(hw, port);
}
Expand Down Expand Up @@ -2144,9 +2138,8 @@ static void sky2_phy_intr(struct sky2_hw *hw, unsigned port)
istatus = gm_phy_read(hw, port, PHY_MARV_INT_STAT);
phystat = gm_phy_read(hw, port, PHY_MARV_PHY_STAT);

if (netif_msg_intr(sky2))
printk(KERN_INFO PFX "%s: phy interrupt status 0x%x 0x%x\n",
sky2->netdev->name, istatus, phystat);
netif_info(sky2, intr, sky2->netdev, "phy interrupt status 0x%x 0x%x\n",
istatus, phystat);

if (istatus & PHY_M_IS_AN_COMPL) {
if (sky2_autoneg_done(sky2, phystat) == 0)
Expand Down Expand Up @@ -2200,8 +2193,7 @@ static void sky2_tx_timeout(struct net_device *dev)
struct sky2_port *sky2 = netdev_priv(dev);
struct sky2_hw *hw = sky2->hw;

if (netif_msg_timer(sky2))
printk(KERN_ERR PFX "%s: tx timeout\n", dev->name);
netif_err(sky2, timer, dev, "tx timeout\n");

printk(KERN_DEBUG PFX "%s: transmit ring %u .. %u report=%u done=%u\n",
dev->name, sky2->tx_cons, sky2->tx_prod,
Expand Down Expand Up @@ -2396,9 +2388,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
count -= VLAN_HLEN;
#endif

if (unlikely(netif_msg_rx_status(sky2)))
printk(KERN_DEBUG PFX "%s: rx slot %u status 0x%x len %d\n",
dev->name, sky2->rx_next, status, length);
netif_printk(sky2, rx_status, KERN_DEBUG, dev,
"rx slot %u status 0x%x len %d\n",
sky2->rx_next, status, length);

sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending;
prefetch(sky2->rx_ring + sky2->rx_next);
Expand Down Expand Up @@ -2439,9 +2431,10 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
/* Truncation of overlength packets
causes PHY length to not match MAC length */
++dev->stats.rx_length_errors;
if (netif_msg_rx_err(sky2) && net_ratelimit())
pr_info(PFX "%s: rx length error: status %#x length %d\n",
dev->name, status, length);
if (net_ratelimit())
netif_info(sky2, rx_err, dev,
"rx length error: status %#x length %d\n",
status, length);
goto resubmit;

error:
Expand All @@ -2451,9 +2444,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
goto resubmit;
}

if (netif_msg_rx_err(sky2) && net_ratelimit())
printk(KERN_INFO PFX "%s: rx error, status 0x%x length %d\n",
dev->name, status, length);
if (net_ratelimit())
netif_info(sky2, rx_err, dev,
"rx error, status 0x%x length %d\n", status, length);

if (status & (GMR_FS_LONG_ERR | GMR_FS_UN_SIZE))
dev->stats.rx_length_errors++;
Expand Down Expand Up @@ -2733,9 +2726,7 @@ static void sky2_mac_intr(struct sky2_hw *hw, unsigned port)
struct sky2_port *sky2 = netdev_priv(dev);
u8 status = sky2_read8(hw, SK_REG(port, GMAC_IRQ_SRC));

if (netif_msg_intr(sky2))
printk(KERN_INFO PFX "%s: mac interrupt status 0x%x\n",
dev->name, status);
netif_info(sky2, intr, dev, "mac interrupt status 0x%x\n", status);

if (status & GM_IS_RX_CO_OV)
gma_read16(hw, port, GM_RX_IRQ_SRC);
Expand Down Expand Up @@ -4529,9 +4520,7 @@ static void __devinit sky2_show_addr(struct net_device *dev)
{
const struct sky2_port *sky2 = netdev_priv(dev);

if (netif_msg_probe(sky2))
printk(KERN_INFO PFX "%s: addr %pM\n",
dev->name, dev->dev_addr);
netif_info(sky2, probe, dev, "addr %pM\n", dev->dev_addr);
}

/* Handle software interrupt used during MSI test */
Expand Down

0 comments on commit 6c35aba

Please sign in to comment.