diff options
author | Hannes Eder <heder@google.com> | 2009-07-30 17:29:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-07-30 17:29:44 -0400 |
commit | 9aada7ac047f789ffb27540cc1695989897b2dfe (patch) | |
tree | c55838fbe9060dd0b7d3857f0c850256d7ba8517 /include/net/ip_vs.h | |
parent | b4076d1715b8a38138db0805a85932b3b650d583 (diff) |
IPVS: use pr_fmt
While being at it cleanup whitespace.
Signed-off-by: Hannes Eder <heder@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r-- | include/net/ip_vs.h | 119 |
1 files changed, 60 insertions, 59 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index bbae1e87efcd..910820327bc4 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -99,47 +99,47 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, | |||
99 | return &buf[*idx - len]; | 99 | return &buf[*idx - len]; |
100 | } | 100 | } |
101 | 101 | ||
102 | #define IP_VS_DBG_BUF(level, msg...) \ | 102 | #define IP_VS_DBG_BUF(level, msg, ...) \ |
103 | do { \ | 103 | do { \ |
104 | char ip_vs_dbg_buf[160]; \ | 104 | char ip_vs_dbg_buf[160]; \ |
105 | int ip_vs_dbg_idx = 0; \ | 105 | int ip_vs_dbg_idx = 0; \ |
106 | if (level <= ip_vs_get_debug_level()) \ | 106 | if (level <= ip_vs_get_debug_level()) \ |
107 | printk(KERN_DEBUG "IPVS: " msg); \ | 107 | printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \ |
108 | } while (0) | 108 | } while (0) |
109 | #define IP_VS_ERR_BUF(msg...) \ | 109 | #define IP_VS_ERR_BUF(msg...) \ |
110 | do { \ | 110 | do { \ |
111 | char ip_vs_dbg_buf[160]; \ | 111 | char ip_vs_dbg_buf[160]; \ |
112 | int ip_vs_dbg_idx = 0; \ | 112 | int ip_vs_dbg_idx = 0; \ |
113 | printk(KERN_ERR "IPVS: " msg); \ | 113 | pr_err(msg); \ |
114 | } while (0) | 114 | } while (0) |
115 | 115 | ||
116 | /* Only use from within IP_VS_DBG_BUF() or IP_VS_ERR_BUF macros */ | 116 | /* Only use from within IP_VS_DBG_BUF() or IP_VS_ERR_BUF macros */ |
117 | #define IP_VS_DBG_ADDR(af, addr) \ | 117 | #define IP_VS_DBG_ADDR(af, addr) \ |
118 | ip_vs_dbg_addr(af, ip_vs_dbg_buf, \ | 118 | ip_vs_dbg_addr(af, ip_vs_dbg_buf, \ |
119 | sizeof(ip_vs_dbg_buf), addr, \ | 119 | sizeof(ip_vs_dbg_buf), addr, \ |
120 | &ip_vs_dbg_idx) | 120 | &ip_vs_dbg_idx) |
121 | 121 | ||
122 | #define IP_VS_DBG(level, msg...) \ | 122 | #define IP_VS_DBG(level, msg, ...) \ |
123 | do { \ | 123 | do { \ |
124 | if (level <= ip_vs_get_debug_level()) \ | 124 | if (level <= ip_vs_get_debug_level()) \ |
125 | printk(KERN_DEBUG "IPVS: " msg); \ | 125 | printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \ |
126 | } while (0) | 126 | } while (0) |
127 | #define IP_VS_DBG_RL(msg...) \ | 127 | #define IP_VS_DBG_RL(msg, ...) \ |
128 | do { \ | 128 | do { \ |
129 | if (net_ratelimit()) \ | 129 | if (net_ratelimit()) \ |
130 | printk(KERN_DEBUG "IPVS: " msg); \ | 130 | printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \ |
131 | } while (0) | 131 | } while (0) |
132 | #define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) \ | 132 | #define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) \ |
133 | do { \ | 133 | do { \ |
134 | if (level <= ip_vs_get_debug_level()) \ | 134 | if (level <= ip_vs_get_debug_level()) \ |
135 | pp->debug_packet(pp, skb, ofs, msg); \ | 135 | pp->debug_packet(pp, skb, ofs, msg); \ |
136 | } while (0) | 136 | } while (0) |
137 | #define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) \ | 137 | #define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) \ |
138 | do { \ | 138 | do { \ |
139 | if (level <= ip_vs_get_debug_level() && \ | 139 | if (level <= ip_vs_get_debug_level() && \ |
140 | net_ratelimit()) \ | 140 | net_ratelimit()) \ |
141 | pp->debug_packet(pp, skb, ofs, msg); \ | 141 | pp->debug_packet(pp, skb, ofs, msg); \ |
142 | } while (0) | 142 | } while (0) |
143 | #else /* NO DEBUGGING at ALL */ | 143 | #else /* NO DEBUGGING at ALL */ |
144 | #define IP_VS_DBG_BUF(level, msg...) do {} while (0) | 144 | #define IP_VS_DBG_BUF(level, msg...) do {} while (0) |
145 | #define IP_VS_ERR_BUF(msg...) do {} while (0) | 145 | #define IP_VS_ERR_BUF(msg...) do {} while (0) |
@@ -150,29 +150,30 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, | |||
150 | #endif | 150 | #endif |
151 | 151 | ||
152 | #define IP_VS_BUG() BUG() | 152 | #define IP_VS_BUG() BUG() |
153 | #define IP_VS_ERR(msg...) printk(KERN_ERR "IPVS: " msg) | 153 | #define IP_VS_ERR(msg...) pr_err(msg) |
154 | #define IP_VS_INFO(msg...) printk(KERN_INFO "IPVS: " msg) | 154 | #define IP_VS_INFO(msg...) pr_info(msg) |
155 | #define IP_VS_WARNING(msg...) \ | 155 | #define IP_VS_WARNING(msg...) pr_warning(msg) |
156 | printk(KERN_WARNING "IPVS: " msg) | 156 | #define IP_VS_ERR_RL(msg...) \ |
157 | #define IP_VS_ERR_RL(msg...) \ | 157 | do { \ |
158 | do { \ | 158 | if (net_ratelimit()) \ |
159 | if (net_ratelimit()) \ | 159 | pr_err(msg); \ |
160 | printk(KERN_ERR "IPVS: " msg); \ | 160 | } while (0) |
161 | } while (0) | ||
162 | 161 | ||
163 | #ifdef CONFIG_IP_VS_DEBUG | 162 | #ifdef CONFIG_IP_VS_DEBUG |
164 | #define EnterFunction(level) \ | 163 | #define EnterFunction(level) \ |
165 | do { \ | 164 | do { \ |
166 | if (level <= ip_vs_get_debug_level()) \ | 165 | if (level <= ip_vs_get_debug_level()) \ |
167 | printk(KERN_DEBUG "Enter: %s, %s line %i\n", \ | 166 | printk(KERN_DEBUG \ |
168 | __func__, __FILE__, __LINE__); \ | 167 | pr_fmt("Enter: %s, %s line %i\n"), \ |
169 | } while (0) | 168 | __func__, __FILE__, __LINE__); \ |
170 | #define LeaveFunction(level) \ | 169 | } while (0) |
171 | do { \ | 170 | #define LeaveFunction(level) \ |
172 | if (level <= ip_vs_get_debug_level()) \ | 171 | do { \ |
173 | printk(KERN_DEBUG "Leave: %s, %s line %i\n", \ | 172 | if (level <= ip_vs_get_debug_level()) \ |
174 | __func__, __FILE__, __LINE__); \ | 173 | printk(KERN_DEBUG \ |
175 | } while (0) | 174 | pr_fmt("Leave: %s, %s line %i\n"), \ |
175 | __func__, __FILE__, __LINE__); \ | ||
176 | } while (0) | ||
176 | #else | 177 | #else |
177 | #define EnterFunction(level) do {} while (0) | 178 | #define EnterFunction(level) do {} while (0) |
178 | #define LeaveFunction(level) do {} while (0) | 179 | #define LeaveFunction(level) do {} while (0) |