Commit 375d6a1b authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

gianfar: Use netdev_<level> when possible

Use a more current logging style.

Convert pr_<level> to netdev_<level> when a struct net_device is
available.  Add pr_fmt and neaten other formats too.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 31b7720c
...@@ -389,14 +389,14 @@ static int gfar_scoalesce(struct net_device *dev, ...@@ -389,14 +389,14 @@ static int gfar_scoalesce(struct net_device *dev,
/* Check the bounds of the values */ /* Check the bounds of the values */
if (cvals->rx_coalesce_usecs > GFAR_MAX_COAL_USECS) { if (cvals->rx_coalesce_usecs > GFAR_MAX_COAL_USECS) {
pr_info("Coalescing is limited to %d microseconds\n", netdev_info(dev, "Coalescing is limited to %d microseconds\n",
GFAR_MAX_COAL_USECS); GFAR_MAX_COAL_USECS);
return -EINVAL; return -EINVAL;
} }
if (cvals->rx_max_coalesced_frames > GFAR_MAX_COAL_FRAMES) { if (cvals->rx_max_coalesced_frames > GFAR_MAX_COAL_FRAMES) {
pr_info("Coalescing is limited to %d frames\n", netdev_info(dev, "Coalescing is limited to %d frames\n",
GFAR_MAX_COAL_FRAMES); GFAR_MAX_COAL_FRAMES);
return -EINVAL; return -EINVAL;
} }
...@@ -418,14 +418,14 @@ static int gfar_scoalesce(struct net_device *dev, ...@@ -418,14 +418,14 @@ static int gfar_scoalesce(struct net_device *dev,
/* Check the bounds of the values */ /* Check the bounds of the values */
if (cvals->tx_coalesce_usecs > GFAR_MAX_COAL_USECS) { if (cvals->tx_coalesce_usecs > GFAR_MAX_COAL_USECS) {
pr_info("Coalescing is limited to %d microseconds\n", netdev_info(dev, "Coalescing is limited to %d microseconds\n",
GFAR_MAX_COAL_USECS); GFAR_MAX_COAL_USECS);
return -EINVAL; return -EINVAL;
} }
if (cvals->tx_max_coalesced_frames > GFAR_MAX_COAL_FRAMES) { if (cvals->tx_max_coalesced_frames > GFAR_MAX_COAL_FRAMES) {
pr_info("Coalescing is limited to %d frames\n", netdev_info(dev, "Coalescing is limited to %d frames\n",
GFAR_MAX_COAL_FRAMES); GFAR_MAX_COAL_FRAMES);
return -EINVAL; return -EINVAL;
} }
...@@ -735,7 +735,8 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow, ...@@ -735,7 +735,8 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow,
cmp_rqfpr = RQFPR_IPV6 |RQFPR_UDP; cmp_rqfpr = RQFPR_IPV6 |RQFPR_UDP;
break; break;
default: default:
pr_err("Right now this class is not supported\n"); netdev_err(priv->ndev,
"Right now this class is not supported\n");
ret = 0; ret = 0;
goto err; goto err;
} }
...@@ -751,7 +752,8 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow, ...@@ -751,7 +752,8 @@ static int gfar_ethflow_to_filer_table(struct gfar_private *priv, u64 ethflow,
} }
if (i == MAX_FILER_IDX + 1) { if (i == MAX_FILER_IDX + 1) {
pr_err("No parse rule found, can't create hash rules\n"); netdev_err(priv->ndev,
"No parse rule found, can't create hash rules\n");
ret = 0; ret = 0;
goto err; goto err;
} }
...@@ -1568,7 +1570,7 @@ static int gfar_process_filer_changes(struct gfar_private *priv) ...@@ -1568,7 +1570,7 @@ static int gfar_process_filer_changes(struct gfar_private *priv)
gfar_cluster_filer(tab); gfar_cluster_filer(tab);
gfar_optimize_filer_masks(tab); gfar_optimize_filer_masks(tab);
pr_debug("\n\tSummary:\n" pr_debug("\tSummary:\n"
"\tData on hardware: %d\n" "\tData on hardware: %d\n"
"\tCompression rate: %d%%\n", "\tCompression rate: %d%%\n",
tab->index, 100 - (100 * tab->index) / i); tab->index, 100 - (100 * tab->index) / i);
......
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/device.h> #include <linux/device.h>
#include <linux/hrtimer.h> #include <linux/hrtimer.h>
#include <linux/init.h> #include <linux/init.h>
......
...@@ -337,5 +337,5 @@ void gfar_init_sysfs(struct net_device *dev) ...@@ -337,5 +337,5 @@ void gfar_init_sysfs(struct net_device *dev)
rc |= device_create_file(&dev->dev, &dev_attr_fifo_starve); rc |= device_create_file(&dev->dev, &dev_attr_fifo_starve);
rc |= device_create_file(&dev->dev, &dev_attr_fifo_starve_off); rc |= device_create_file(&dev->dev, &dev_attr_fifo_starve_off);
if (rc) if (rc)
dev_err(&dev->dev, "Error creating gianfar sysfs files.\n"); dev_err(&dev->dev, "Error creating gianfar sysfs files\n");
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment