From 59deab26c1974b29b7f501e0ace0673d5acadae1 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Tue, 14 Jun 2011 08:57:47 +0000 Subject: gianfar: Use pr_, netdev_ and netif_ Use the current logging styles. Add #define DEBUG to get same output for _dbg messages. Convert a few bare printks to pr_err. Fix a likely copy/paste defect where a test was done with RX values: if (num_rx_qs > MAX_RX_QS) { but TX limits were emitted: printk(KERN_ERR "num_rx_qs(=%d) greater than MAX_RX_QS(=%d)\n", num_tx_qs, MAX_TX_QS); Signed-off-by: Joe Perches Signed-off-by: David S. Miller --- drivers/net/gianfar_ethtool.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'drivers/net/gianfar_ethtool.c') diff --git a/drivers/net/gianfar_ethtool.c b/drivers/net/gianfar_ethtool.c index 493d743839d9..92d7ac09c87a 100644 --- a/drivers/net/gianfar_ethtool.c +++ b/drivers/net/gianfar_ethtool.c @@ -16,6 +16,8 @@ * by reference. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include #include #include @@ -375,13 +377,13 @@ static int gfar_scoalesce(struct net_device *dev, struct ethtool_coalesce *cvals /* Check the bounds of the values */ if (cvals->rx_coalesce_usecs > GFAR_MAX_COAL_USECS) { pr_info("Coalescing is limited to %d microseconds\n", - GFAR_MAX_COAL_USECS); + GFAR_MAX_COAL_USECS); return -EINVAL; } if (cvals->rx_max_coalesced_frames > GFAR_MAX_COAL_FRAMES) { pr_info("Coalescing is limited to %d frames\n", - GFAR_MAX_COAL_FRAMES); + GFAR_MAX_COAL_FRAMES); return -EINVAL; } @@ -404,13 +406,13 @@ static int gfar_scoalesce(struct net_device *dev, struct ethtool_coalesce *cvals /* Check the bounds of the values */ if (cvals->tx_coalesce_usecs > GFAR_MAX_COAL_USECS) { pr_info("Coalescing is limited to %d microseconds\n", - GFAR_MAX_COAL_USECS); + GFAR_MAX_COAL_USECS); return -EINVAL; } if (cvals->tx_max_coalesced_frames > GFAR_MAX_COAL_FRAMES) { pr_info("Coalescing is limited to %d frames\n", - GFAR_MAX_COAL_FRAMES); + GFAR_MAX_COAL_FRAMES); return -EINVAL; } @@ -464,8 +466,7 @@ static int gfar_sringparam(struct net_device *dev, struct ethtool_ringparam *rva return -EINVAL; if (!is_power_of_2(rvals->rx_pending)) { - printk("%s: Ring sizes must be a power of 2\n", - dev->name); + netdev_err(dev, "Ring sizes must be a power of 2\n"); return -EINVAL; } @@ -473,8 +474,7 @@ static int gfar_sringparam(struct net_device *dev, struct ethtool_ringparam *rva return -EINVAL; if (!is_power_of_2(rvals->tx_pending)) { - printk("%s: Ring sizes must be a power of 2\n", - dev->name); + netdev_err(dev, "Ring sizes must be a power of 2\n"); return -EINVAL; } @@ -700,7 +700,7 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow, u cmp_rqfpr = RQFPR_IPV6 |RQFPR_UDP; break; default: - printk(KERN_ERR "Right now this class is not supported\n"); + pr_err("Right now this class is not supported\n"); return 0; } @@ -715,8 +715,7 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow, u } if (i == MAX_FILER_IDX + 1) { - printk(KERN_ERR "No parse rule found, "); - printk(KERN_ERR "can't create hash rules\n"); + pr_err("No parse rule found, can't create hash rules\n"); return 0; } -- cgit v1.2.3-59-g8ed1b