Skip to content

Commit 9b9fae8

Browse files
geertuRich Felker
authored andcommitted
sh: kernel: disassemble: Fix broken lines in disassembly dumps
Rejoin the broken lines by using pr_cont(). Convert the remaining printk() calls to pr_*() while at it. Signed-off-by: Geert Uytterhoeven <[email protected]> Tested-by: Guenter Roeck <[email protected]> Signed-off-by: Rich Felker <[email protected]>
1 parent f6bed86 commit 9b9fae8

File tree

1 file changed

+52
-51
lines changed

1 file changed

+52
-51
lines changed

arch/sh/kernel/disassemble.c

Lines changed: 52 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -376,148 +376,148 @@ static void print_sh_insn(u32 memaddr, u16 insn)
376376
}
377377

378378
ok:
379-
printk("%-8s ", op->name);
379+
pr_cont("%-8s ", op->name);
380380
lastsp = (op->arg[0] == A_END);
381381
disp_pc = 0;
382382
for (n = 0; n < 6 && op->arg[n] != A_END; n++) {
383383
if (n && op->arg[1] != A_END)
384-
printk(", ");
384+
pr_cont(", ");
385385
switch (op->arg[n]) {
386386
case A_IMM:
387-
printk("#%d", (char)(imm));
387+
pr_cont("#%d", (char)(imm));
388388
break;
389389
case A_R0:
390-
printk("r0");
390+
pr_cont("r0");
391391
break;
392392
case A_REG_N:
393-
printk("r%d", rn);
393+
pr_cont("r%d", rn);
394394
break;
395395
case A_INC_N:
396-
printk("@r%d+", rn);
396+
pr_cont("@r%d+", rn);
397397
break;
398398
case A_DEC_N:
399-
printk("@-r%d", rn);
399+
pr_cont("@-r%d", rn);
400400
break;
401401
case A_IND_N:
402-
printk("@r%d", rn);
402+
pr_cont("@r%d", rn);
403403
break;
404404
case A_DISP_REG_N:
405-
printk("@(%d,r%d)", imm, rn);
405+
pr_cont("@(%d,r%d)", imm, rn);
406406
break;
407407
case A_REG_M:
408-
printk("r%d", rm);
408+
pr_cont("r%d", rm);
409409
break;
410410
case A_INC_M:
411-
printk("@r%d+", rm);
411+
pr_cont("@r%d+", rm);
412412
break;
413413
case A_DEC_M:
414-
printk("@-r%d", rm);
414+
pr_cont("@-r%d", rm);
415415
break;
416416
case A_IND_M:
417-
printk("@r%d", rm);
417+
pr_cont("@r%d", rm);
418418
break;
419419
case A_DISP_REG_M:
420-
printk("@(%d,r%d)", imm, rm);
420+
pr_cont("@(%d,r%d)", imm, rm);
421421
break;
422422
case A_REG_B:
423-
printk("r%d_bank", rb);
423+
pr_cont("r%d_bank", rb);
424424
break;
425425
case A_DISP_PC:
426426
disp_pc = 1;
427427
disp_pc_addr = imm + 4 + (memaddr & relmask);
428-
printk("%08x <%pS>", disp_pc_addr,
429-
(void *)disp_pc_addr);
428+
pr_cont("%08x <%pS>", disp_pc_addr,
429+
(void *)disp_pc_addr);
430430
break;
431431
case A_IND_R0_REG_N:
432-
printk("@(r0,r%d)", rn);
432+
pr_cont("@(r0,r%d)", rn);
433433
break;
434434
case A_IND_R0_REG_M:
435-
printk("@(r0,r%d)", rm);
435+
pr_cont("@(r0,r%d)", rm);
436436
break;
437437
case A_DISP_GBR:
438-
printk("@(%d,gbr)",imm);
438+
pr_cont("@(%d,gbr)", imm);
439439
break;
440440
case A_R0_GBR:
441-
printk("@(r0,gbr)");
441+
pr_cont("@(r0,gbr)");
442442
break;
443443
case A_BDISP12:
444444
case A_BDISP8:
445-
printk("%08x", imm + memaddr);
445+
pr_cont("%08x", imm + memaddr);
446446
break;
447447
case A_SR:
448-
printk("sr");
448+
pr_cont("sr");
449449
break;
450450
case A_GBR:
451-
printk("gbr");
451+
pr_cont("gbr");
452452
break;
453453
case A_VBR:
454-
printk("vbr");
454+
pr_cont("vbr");
455455
break;
456456
case A_SSR:
457-
printk("ssr");
457+
pr_cont("ssr");
458458
break;
459459
case A_SPC:
460-
printk("spc");
460+
pr_cont("spc");
461461
break;
462462
case A_MACH:
463-
printk("mach");
463+
pr_cont("mach");
464464
break;
465465
case A_MACL:
466-
printk("macl");
466+
pr_cont("macl");
467467
break;
468468
case A_PR:
469-
printk("pr");
469+
pr_cont("pr");
470470
break;
471471
case A_SGR:
472-
printk("sgr");
472+
pr_cont("sgr");
473473
break;
474474
case A_DBR:
475-
printk("dbr");
475+
pr_cont("dbr");
476476
break;
477477
case FD_REG_N:
478478
case F_REG_N:
479-
printk("fr%d", rn);
479+
pr_cont("fr%d", rn);
480480
break;
481481
case F_REG_M:
482-
printk("fr%d", rm);
482+
pr_cont("fr%d", rm);
483483
break;
484484
case DX_REG_N:
485485
if (rn & 1) {
486-
printk("xd%d", rn & ~1);
486+
pr_cont("xd%d", rn & ~1);
487487
break;
488488
}
489489
/* else, fall through */
490490
case D_REG_N:
491-
printk("dr%d", rn);
491+
pr_cont("dr%d", rn);
492492
break;
493493
case DX_REG_M:
494494
if (rm & 1) {
495-
printk("xd%d", rm & ~1);
495+
pr_cont("xd%d", rm & ~1);
496496
break;
497497
}
498498
/* else, fall through */
499499
case D_REG_M:
500-
printk("dr%d", rm);
500+
pr_cont("dr%d", rm);
501501
break;
502502
case FPSCR_M:
503503
case FPSCR_N:
504-
printk("fpscr");
504+
pr_cont("fpscr");
505505
break;
506506
case FPUL_M:
507507
case FPUL_N:
508-
printk("fpul");
508+
pr_cont("fpul");
509509
break;
510510
case F_FR0:
511-
printk("fr0");
511+
pr_cont("fr0");
512512
break;
513513
case V_REG_N:
514-
printk("fv%d", rn*4);
514+
pr_cont("fv%d", rn*4);
515515
break;
516516
case V_REG_M:
517-
printk("fv%d", rm*4);
517+
pr_cont("fv%d", rm*4);
518518
break;
519519
case XMTRX_M4:
520-
printk("xmtrx");
520+
pr_cont("xmtrx");
521521
break;
522522
default:
523523
return;
@@ -532,7 +532,7 @@ static void print_sh_insn(u32 memaddr, u16 insn)
532532
else
533533
__get_user(val, (u32 *)disp_pc_addr);
534534

535-
printk(" ! %08x <%pS>", val, (void *)val);
535+
pr_cont(" ! %08x <%pS>", val, (void *)val);
536536
}
537537

538538
return;
@@ -541,7 +541,7 @@ static void print_sh_insn(u32 memaddr, u16 insn)
541541

542542
}
543543

544-
printk(".word 0x%x%x%x%x", nibs[0], nibs[1], nibs[2], nibs[3]);
544+
pr_info(".word 0x%x%x%x%x", nibs[0], nibs[1], nibs[2], nibs[3]);
545545
}
546546

547547
void show_code(struct pt_regs *regs)
@@ -552,20 +552,21 @@ void show_code(struct pt_regs *regs)
552552
if (regs->pc & 0x1)
553553
return;
554554

555-
printk("Code:\n");
555+
pr_info("Code:\n");
556556

557557
for (i = -3 ; i < 6 ; i++) {
558558
unsigned short insn;
559559

560560
if (__get_user(insn, pc + i)) {
561-
printk(" (Bad address in pc)\n");
561+
pr_err(" (Bad address in pc)\n");
562562
break;
563563
}
564564

565-
printk("%s%08lx: ", (i ? " ": "->"), (unsigned long)(pc + i));
565+
pr_info("%s%08lx: ", (i ? " " : "->"),
566+
(unsigned long)(pc + i));
566567
print_sh_insn((unsigned long)(pc + i), insn);
567-
printk("\n");
568+
pr_cont("\n");
568569
}
569570

570-
printk("\n");
571+
pr_info("\n");
571572
}

0 commit comments

Comments
 (0)