aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/mcelog.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-06-28 06:21:41 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-06-28 11:19:58 -0400
commit283c0972d53769ee44750cad4c27e3f5fa26ec1f (patch)
tree598a36146515f114e21047daa9e19ea8ac8e5fdc /drivers/xen/mcelog.c
parent65e053a7038c608f89272d4fb1f899890c579f0a (diff)
xen: Convert printks to pr_<level>
Convert printks to pr_<level> (excludes printk(KERN_DEBUG...) to be more consistent throughout the xen subsystem. Add pr_fmt with KBUILD_MODNAME or "xen:" KBUILD_MODNAME Coalesce formats and add missing word spaces Add missing newlines Align arguments and reflow to 80 columns Remove DRV_NAME from formats as pr_fmt adds the same content This does change some of the prefixes of these messages but it also does make them more consistent. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/xen/mcelog.c')
-rw-r--r--drivers/xen/mcelog.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/drivers/xen/mcelog.c b/drivers/xen/mcelog.c
index 8feee08bcb43..6ab6a79c38a5 100644
--- a/drivers/xen/mcelog.c
+++ b/drivers/xen/mcelog.c
@@ -32,6 +32,8 @@
32 * IN THE SOFTWARE. 32 * IN THE SOFTWARE.
33 */ 33 */
34 34
35#define pr_fmt(fmt) "xen_mcelog: " fmt
36
35#include <linux/init.h> 37#include <linux/init.h>
36#include <linux/types.h> 38#include <linux/types.h>
37#include <linux/kernel.h> 39#include <linux/kernel.h>
@@ -51,8 +53,6 @@
51#include <asm/xen/hypercall.h> 53#include <asm/xen/hypercall.h>
52#include <asm/xen/hypervisor.h> 54#include <asm/xen/hypervisor.h>
53 55
54#define XEN_MCELOG "xen_mcelog: "
55
56static struct mc_info g_mi; 56static struct mc_info g_mi;
57static struct mcinfo_logical_cpu *g_physinfo; 57static struct mcinfo_logical_cpu *g_physinfo;
58static uint32_t ncpus; 58static uint32_t ncpus;
@@ -227,7 +227,7 @@ static int convert_log(struct mc_info *mi)
227 mic = NULL; 227 mic = NULL;
228 x86_mcinfo_lookup(&mic, mi, MC_TYPE_GLOBAL); 228 x86_mcinfo_lookup(&mic, mi, MC_TYPE_GLOBAL);
229 if (unlikely(!mic)) { 229 if (unlikely(!mic)) {
230 pr_warning(XEN_MCELOG "Failed to find global error info\n"); 230 pr_warn("Failed to find global error info\n");
231 return -ENODEV; 231 return -ENODEV;
232 } 232 }
233 233
@@ -241,8 +241,7 @@ static int convert_log(struct mc_info *mi)
241 if (g_physinfo[i].mc_apicid == m.apicid) 241 if (g_physinfo[i].mc_apicid == m.apicid)
242 break; 242 break;
243 if (unlikely(i == ncpus)) { 243 if (unlikely(i == ncpus)) {
244 pr_warning(XEN_MCELOG "Failed to match cpu with apicid %d\n", 244 pr_warn("Failed to match cpu with apicid %d\n", m.apicid);
245 m.apicid);
246 return -ENODEV; 245 return -ENODEV;
247 } 246 }
248 247
@@ -254,7 +253,7 @@ static int convert_log(struct mc_info *mi)
254 mic = NULL; 253 mic = NULL;
255 x86_mcinfo_lookup(&mic, mi, MC_TYPE_BANK); 254 x86_mcinfo_lookup(&mic, mi, MC_TYPE_BANK);
256 if (unlikely(!mic)) { 255 if (unlikely(!mic)) {
257 pr_warning(XEN_MCELOG "Fail to find bank error info\n"); 256 pr_warn("Fail to find bank error info\n");
258 return -ENODEV; 257 return -ENODEV;
259 } 258 }
260 259
@@ -295,9 +294,8 @@ static int mc_queue_handle(uint32_t flags)
295 mc_op.u.mc_fetch.flags = flags; 294 mc_op.u.mc_fetch.flags = flags;
296 ret = HYPERVISOR_mca(&mc_op); 295 ret = HYPERVISOR_mca(&mc_op);
297 if (ret) { 296 if (ret) {
298 pr_err(XEN_MCELOG "Failed to fetch %s error log\n", 297 pr_err("Failed to fetch %surgent error log\n",
299 (flags == XEN_MC_URGENT) ? 298 flags == XEN_MC_URGENT ? "" : "non");
300 "urgnet" : "nonurgent");
301 break; 299 break;
302 } 300 }
303 301
@@ -307,15 +305,12 @@ static int mc_queue_handle(uint32_t flags)
307 else { 305 else {
308 ret = convert_log(&g_mi); 306 ret = convert_log(&g_mi);
309 if (ret) 307 if (ret)
310 pr_warning(XEN_MCELOG 308 pr_warn("Failed to convert this error log, continue acking it anyway\n");
311 "Failed to convert this error log, "
312 "continue acking it anyway\n");
313 309
314 mc_op.u.mc_fetch.flags = flags | XEN_MC_ACK; 310 mc_op.u.mc_fetch.flags = flags | XEN_MC_ACK;
315 ret = HYPERVISOR_mca(&mc_op); 311 ret = HYPERVISOR_mca(&mc_op);
316 if (ret) { 312 if (ret) {
317 pr_err(XEN_MCELOG 313 pr_err("Failed to ack previous error log\n");
318 "Failed to ack previous error log\n");
319 break; 314 break;
320 } 315 }
321 } 316 }
@@ -334,15 +329,12 @@ static void xen_mce_work_fn(struct work_struct *work)
334 /* urgent mc_info */ 329 /* urgent mc_info */
335 err = mc_queue_handle(XEN_MC_URGENT); 330 err = mc_queue_handle(XEN_MC_URGENT);
336 if (err) 331 if (err)
337 pr_err(XEN_MCELOG 332 pr_err("Failed to handle urgent mc_info queue, continue handling nonurgent mc_info queue anyway\n");
338 "Failed to handle urgent mc_info queue, "
339 "continue handling nonurgent mc_info queue anyway.\n");
340 333
341 /* nonurgent mc_info */ 334 /* nonurgent mc_info */
342 err = mc_queue_handle(XEN_MC_NONURGENT); 335 err = mc_queue_handle(XEN_MC_NONURGENT);
343 if (err) 336 if (err)
344 pr_err(XEN_MCELOG 337 pr_err("Failed to handle nonurgent mc_info queue\n");
345 "Failed to handle nonurgent mc_info queue.\n");
346 338
347 /* wake processes polling /dev/mcelog */ 339 /* wake processes polling /dev/mcelog */
348 wake_up_interruptible(&xen_mce_chrdev_wait); 340 wake_up_interruptible(&xen_mce_chrdev_wait);
@@ -370,7 +362,7 @@ static int bind_virq_for_mce(void)
370 set_xen_guest_handle(mc_op.u.mc_physcpuinfo.info, g_physinfo); 362 set_xen_guest_handle(mc_op.u.mc_physcpuinfo.info, g_physinfo);
371 ret = HYPERVISOR_mca(&mc_op); 363 ret = HYPERVISOR_mca(&mc_op);
372 if (ret) { 364 if (ret) {
373 pr_err(XEN_MCELOG "Failed to get CPU numbers\n"); 365 pr_err("Failed to get CPU numbers\n");
374 return ret; 366 return ret;
375 } 367 }
376 368
@@ -383,7 +375,7 @@ static int bind_virq_for_mce(void)
383 set_xen_guest_handle(mc_op.u.mc_physcpuinfo.info, g_physinfo); 375 set_xen_guest_handle(mc_op.u.mc_physcpuinfo.info, g_physinfo);
384 ret = HYPERVISOR_mca(&mc_op); 376 ret = HYPERVISOR_mca(&mc_op);
385 if (ret) { 377 if (ret) {
386 pr_err(XEN_MCELOG "Failed to get CPU info\n"); 378 pr_err("Failed to get CPU info\n");
387 kfree(g_physinfo); 379 kfree(g_physinfo);
388 return ret; 380 return ret;
389 } 381 }
@@ -391,7 +383,7 @@ static int bind_virq_for_mce(void)
391 ret = bind_virq_to_irqhandler(VIRQ_MCA, 0, 383 ret = bind_virq_to_irqhandler(VIRQ_MCA, 0,
392 xen_mce_interrupt, 0, "mce", NULL); 384 xen_mce_interrupt, 0, "mce", NULL);
393 if (ret < 0) { 385 if (ret < 0) {
394 pr_err(XEN_MCELOG "Failed to bind virq\n"); 386 pr_err("Failed to bind virq\n");
395 kfree(g_physinfo); 387 kfree(g_physinfo);
396 return ret; 388 return ret;
397 } 389 }