diff options
author | Joe Perches <joe@perches.com> | 2010-02-17 10:01:52 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 20:45:20 -0500 |
commit | 7995c64e5b56ec7fe6032e5fc586f726cde2152b (patch) | |
tree | b072d2e42f717d8f2c3d94e9431c48a3e8304f72 /drivers/net/bnx2x.h | |
parent | 3a9c6a4915e584663aebdb9016bcb9d3897dd779 (diff) |
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: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x.h')
-rw-r--r-- | drivers/net/bnx2x.h | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index d997d8472ee5..3c48a7a68308 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -44,7 +44,6 @@ | |||
44 | /* error/debug prints */ | 44 | /* error/debug prints */ |
45 | 45 | ||
46 | #define DRV_MODULE_NAME "bnx2x" | 46 | #define DRV_MODULE_NAME "bnx2x" |
47 | #define PFX DRV_MODULE_NAME ": " | ||
48 | 47 | ||
49 | /* for messages that are currently off */ | 48 | /* for messages that are currently off */ |
50 | #define BNX2X_MSG_OFF 0 | 49 | #define BNX2X_MSG_OFF 0 |
@@ -58,30 +57,40 @@ | |||
58 | #define DP_LEVEL KERN_NOTICE /* was: KERN_DEBUG */ | 57 | #define DP_LEVEL KERN_NOTICE /* was: KERN_DEBUG */ |
59 | 58 | ||
60 | /* regular debug print */ | 59 | /* regular debug print */ |
61 | #define DP(__mask, __fmt, __args...) do { \ | 60 | #define DP(__mask, __fmt, __args...) \ |
62 | if (bp->msglevel & (__mask)) \ | 61 | do { \ |
63 | printk(DP_LEVEL "[%s:%d(%s)]" __fmt, __func__, __LINE__, \ | 62 | if (bp->msg_enable & (__mask)) \ |
64 | bp->dev ? (bp->dev->name) : "?", ##__args); \ | 63 | printk(DP_LEVEL "[%s:%d(%s)]" __fmt, \ |
65 | } while (0) | 64 | __func__, __LINE__, \ |
65 | bp->dev ? (bp->dev->name) : "?", \ | ||
66 | ##__args); \ | ||
67 | } while (0) | ||
66 | 68 | ||
67 | /* errors debug print */ | 69 | /* errors debug print */ |
68 | #define BNX2X_DBG_ERR(__fmt, __args...) do { \ | 70 | #define BNX2X_DBG_ERR(__fmt, __args...) \ |
69 | if (bp->msglevel & NETIF_MSG_PROBE) \ | 71 | do { \ |
70 | printk(KERN_ERR "[%s:%d(%s)]" __fmt, __func__, __LINE__, \ | 72 | if (netif_msg_probe(bp)) \ |
71 | bp->dev ? (bp->dev->name) : "?", ##__args); \ | 73 | pr_err("[%s:%d(%s)]" __fmt, \ |
72 | } while (0) | 74 | __func__, __LINE__, \ |
75 | bp->dev ? (bp->dev->name) : "?", \ | ||
76 | ##__args); \ | ||
77 | } while (0) | ||
73 | 78 | ||
74 | /* for errors (never masked) */ | 79 | /* for errors (never masked) */ |
75 | #define BNX2X_ERR(__fmt, __args...) do { \ | 80 | #define BNX2X_ERR(__fmt, __args...) \ |
76 | printk(KERN_ERR "[%s:%d(%s)]" __fmt, __func__, __LINE__, \ | 81 | do { \ |
77 | bp->dev ? (bp->dev->name) : "?", ##__args); \ | 82 | pr_err("[%s:%d(%s)]" __fmt, \ |
78 | } while (0) | 83 | __func__, __LINE__, \ |
84 | bp->dev ? (bp->dev->name) : "?", \ | ||
85 | ##__args); \ | ||
86 | } while (0) | ||
79 | 87 | ||
80 | /* before we have a dev->name use dev_info() */ | 88 | /* before we have a dev->name use dev_info() */ |
81 | #define BNX2X_DEV_INFO(__fmt, __args...) do { \ | 89 | #define BNX2X_DEV_INFO(__fmt, __args...) \ |
82 | if (bp->msglevel & NETIF_MSG_PROBE) \ | 90 | do { \ |
83 | dev_info(&bp->pdev->dev, __fmt, ##__args); \ | 91 | if (netif_msg_probe(bp)) \ |
84 | } while (0) | 92 | dev_info(&bp->pdev->dev, __fmt, ##__args); \ |
93 | } while (0) | ||
85 | 94 | ||
86 | 95 | ||
87 | #ifdef BNX2X_STOP_ON_ERROR | 96 | #ifdef BNX2X_STOP_ON_ERROR |
@@ -882,7 +891,7 @@ struct bnx2x { | |||
882 | /* End of fields used in the performance code paths */ | 891 | /* End of fields used in the performance code paths */ |
883 | 892 | ||
884 | int panic; | 893 | int panic; |
885 | int msglevel; | 894 | int msg_enable; |
886 | 895 | ||
887 | u32 flags; | 896 | u32 flags; |
888 | #define PCIX_FLAG 1 | 897 | #define PCIX_FLAG 1 |