gianfar: Use pr_<level>, netdev_<level> and netif_<level>

Use the current logging styles.

Add #define DEBUG to get same output for <foo>_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 <joe@perches.com>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
This commit is contained in:
Joe Perches
2011-06-14 08:57:47 +00:00
committed by David S. Miller
parent ea11073387
commit 59deab26c1
2 changed files with 58 additions and 76 deletions

View File

@ -16,6 +16,8 @@
* by reference.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/errno.h>
@ -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;
}