diff options
author | Joe Perches <joe@perches.com> | 2010-11-09 19:35:19 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-16 16:37:05 -0500 |
commit | 0e67d6cb753643fc076a90fa9309301b3fbfb8db (patch) | |
tree | 4da0de9c926d6e47fd76c4b821b626a0366dc4e4 /drivers/net/wireless/b43legacy/main.c | |
parent | 5b736d42bc51fe893fd7d4ceac34c727d23135e1 (diff) |
drivers/net/wireless/b43legacy/main.c: Use printf extension %pV
Using %pV reduces the number of printk calls and
eliminates any possible message interleaving from
other printk calls.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43legacy/main.c')
-rw-r--r-- | drivers/net/wireless/b43legacy/main.c | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c index 67f18ecdb3b..1f11e1670bf 100644 --- a/drivers/net/wireless/b43legacy/main.c +++ b/drivers/net/wireless/b43legacy/main.c | |||
@@ -181,52 +181,75 @@ static int b43legacy_ratelimit(struct b43legacy_wl *wl) | |||
181 | 181 | ||
182 | void b43legacyinfo(struct b43legacy_wl *wl, const char *fmt, ...) | 182 | void b43legacyinfo(struct b43legacy_wl *wl, const char *fmt, ...) |
183 | { | 183 | { |
184 | struct va_format vaf; | ||
184 | va_list args; | 185 | va_list args; |
185 | 186 | ||
186 | if (!b43legacy_ratelimit(wl)) | 187 | if (!b43legacy_ratelimit(wl)) |
187 | return; | 188 | return; |
189 | |||
188 | va_start(args, fmt); | 190 | va_start(args, fmt); |
189 | printk(KERN_INFO "b43legacy-%s: ", | 191 | |
190 | (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan"); | 192 | vaf.fmt = fmt; |
191 | vprintk(fmt, args); | 193 | vaf.va = &args; |
194 | |||
195 | printk(KERN_INFO "b43legacy-%s: %pV", | ||
196 | (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf); | ||
197 | |||
192 | va_end(args); | 198 | va_end(args); |
193 | } | 199 | } |
194 | 200 | ||
195 | void b43legacyerr(struct b43legacy_wl *wl, const char *fmt, ...) | 201 | void b43legacyerr(struct b43legacy_wl *wl, const char *fmt, ...) |
196 | { | 202 | { |
203 | struct va_format vaf; | ||
197 | va_list args; | 204 | va_list args; |
198 | 205 | ||
199 | if (!b43legacy_ratelimit(wl)) | 206 | if (!b43legacy_ratelimit(wl)) |
200 | return; | 207 | return; |
208 | |||
201 | va_start(args, fmt); | 209 | va_start(args, fmt); |
202 | printk(KERN_ERR "b43legacy-%s ERROR: ", | 210 | |
203 | (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan"); | 211 | vaf.fmt = fmt; |
204 | vprintk(fmt, args); | 212 | vaf.va = &args; |
213 | |||
214 | printk(KERN_ERR "b43legacy-%s ERROR: %pV", | ||
215 | (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf); | ||
216 | |||
205 | va_end(args); | 217 | va_end(args); |
206 | } | 218 | } |
207 | 219 | ||
208 | void b43legacywarn(struct b43legacy_wl *wl, const char *fmt, ...) | 220 | void b43legacywarn(struct b43legacy_wl *wl, const char *fmt, ...) |
209 | { | 221 | { |
222 | struct va_format vaf; | ||
210 | va_list args; | 223 | va_list args; |
211 | 224 | ||
212 | if (!b43legacy_ratelimit(wl)) | 225 | if (!b43legacy_ratelimit(wl)) |
213 | return; | 226 | return; |
227 | |||
214 | va_start(args, fmt); | 228 | va_start(args, fmt); |
215 | printk(KERN_WARNING "b43legacy-%s warning: ", | 229 | |
216 | (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan"); | 230 | vaf.fmt = fmt; |
217 | vprintk(fmt, args); | 231 | vaf.va = &args; |
232 | |||
233 | printk(KERN_WARNING "b43legacy-%s warning: %pV", | ||
234 | (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf); | ||
235 | |||
218 | va_end(args); | 236 | va_end(args); |
219 | } | 237 | } |
220 | 238 | ||
221 | #if B43legacy_DEBUG | 239 | #if B43legacy_DEBUG |
222 | void b43legacydbg(struct b43legacy_wl *wl, const char *fmt, ...) | 240 | void b43legacydbg(struct b43legacy_wl *wl, const char *fmt, ...) |
223 | { | 241 | { |
242 | struct va_format vaf; | ||
224 | va_list args; | 243 | va_list args; |
225 | 244 | ||
226 | va_start(args, fmt); | 245 | va_start(args, fmt); |
227 | printk(KERN_DEBUG "b43legacy-%s debug: ", | 246 | |
228 | (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan"); | 247 | vaf.fmt = fmt; |
229 | vprintk(fmt, args); | 248 | vaf.va = &args; |
249 | |||
250 | printk(KERN_DEBUG "b43legacy-%s debug: %pV", | ||
251 | (wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan", &vaf); | ||
252 | |||
230 | va_end(args); | 253 | va_end(args); |
231 | } | 254 | } |
232 | #endif /* DEBUG */ | 255 | #endif /* DEBUG */ |