Commit 7995c64e authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

drivers/net/bnx2x: Use (pr|netdev|netif)_<level> macro helpers

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Convert struct bnx2x member msglevel to msg_enable for netif_msg_<foo> macros
Remove #define PFX
Use pr_<level>
Use netdev_<level>
Use netif_<level>
Coalesce long formats
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3a9c6a49
......@@ -44,7 +44,6 @@
/* error/debug prints */
#define DRV_MODULE_NAME "bnx2x"
#define PFX DRV_MODULE_NAME ": "
/* for messages that are currently off */
#define BNX2X_MSG_OFF 0
......@@ -58,30 +57,40 @@
#define DP_LEVEL KERN_NOTICE /* was: KERN_DEBUG */
/* regular debug print */
#define DP(__mask, __fmt, __args...) do { \
if (bp->msglevel & (__mask)) \
printk(DP_LEVEL "[%s:%d(%s)]" __fmt, __func__, __LINE__, \
bp->dev ? (bp->dev->name) : "?", ##__args); \
} while (0)
#define DP(__mask, __fmt, __args...) \
do { \
if (bp->msg_enable & (__mask)) \
printk(DP_LEVEL "[%s:%d(%s)]" __fmt, \
__func__, __LINE__, \
bp->dev ? (bp->dev->name) : "?", \
##__args); \
} while (0)
/* errors debug print */
#define BNX2X_DBG_ERR(__fmt, __args...) do { \
if (bp->msglevel & NETIF_MSG_PROBE) \
printk(KERN_ERR "[%s:%d(%s)]" __fmt, __func__, __LINE__, \
bp->dev ? (bp->dev->name) : "?", ##__args); \
} while (0)
#define BNX2X_DBG_ERR(__fmt, __args...) \
do { \
if (netif_msg_probe(bp)) \
pr_err("[%s:%d(%s)]" __fmt, \
__func__, __LINE__, \
bp->dev ? (bp->dev->name) : "?", \
##__args); \
} while (0)
/* for errors (never masked) */
#define BNX2X_ERR(__fmt, __args...) do { \
printk(KERN_ERR "[%s:%d(%s)]" __fmt, __func__, __LINE__, \
bp->dev ? (bp->dev->name) : "?", ##__args); \
} while (0)
#define BNX2X_ERR(__fmt, __args...) \
do { \
pr_err("[%s:%d(%s)]" __fmt, \
__func__, __LINE__, \
bp->dev ? (bp->dev->name) : "?", \
##__args); \
} while (0)
/* before we have a dev->name use dev_info() */
#define BNX2X_DEV_INFO(__fmt, __args...) do { \
if (bp->msglevel & NETIF_MSG_PROBE) \
dev_info(&bp->pdev->dev, __fmt, ##__args); \
} while (0)
#define BNX2X_DEV_INFO(__fmt, __args...) \
do { \
if (netif_msg_probe(bp)) \
dev_info(&bp->pdev->dev, __fmt, ##__args); \
} while (0)
#ifdef BNX2X_STOP_ON_ERROR
......@@ -882,7 +891,7 @@ struct bnx2x {
/* End of fields used in the performance code paths */
int panic;
int msglevel;
int msg_enable;
u32 flags;
#define PCIX_FLAG 1
......
......@@ -14,6 +14,8 @@
*
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/pci.h>
......@@ -2987,11 +2989,8 @@ static u8 bnx2x_verify_sfp_module(struct link_params *params)
else
vendor_pn[SFP_EEPROM_PART_NO_SIZE] = '\0';
printk(KERN_INFO PFX "Warning: "
"Unqualified SFP+ module "
"detected on %s, Port %d from %s part number %s\n"
, bp->dev->name, params->port,
vendor_name, vendor_pn);
netdev_info(bp->dev, "Warning: Unqualified SFP+ module detected, Port %d from %s part number %s\n",
params->port, vendor_name, vendor_pn);
return -EINVAL;
}
......@@ -4846,16 +4845,8 @@ static u8 bnx2x_ext_phy_is_link_up(struct link_params *params,
" has been detected on "
"port %d\n",
params->port);
printk(KERN_ERR PFX "Error: Power"
" fault on %s Port %d has"
" been detected and the"
" power to that SFP+ module"
" has been removed to prevent"
" failure of the card. Please"
" remove the SFP+ module and"
" restart the system to clear"
" this error.\n"
, bp->dev->name, params->port);
netdev_err(bp->dev, "Error: Power fault on Port %d has been detected and the power to that SFP+ module has been removed to prevent failure of the card. Please remove the SFP+ module and restart the system to clear this error.\n",
params->port);
/*
* Disable all RX_ALARMs except for
* mod_abs
......
This diff is collapsed.
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