Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp539974ybt; Wed, 17 Jun 2020 07:39:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZZhNHTNL/u4GnXKZfkAmpbr6whsQJc4cdfCETx6Lt5MMAzLMk60AlskQ2JAO3UWVCI4fo X-Received: by 2002:aa7:d359:: with SMTP id m25mr7305864edr.365.1592404744066; Wed, 17 Jun 2020 07:39:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592404744; cv=none; d=google.com; s=arc-20160816; b=o/jgv4luiDd5F93XOwuybiiBazmF1UobgWrWP49omkjHtE0tfjHR8o4+S2K1pYPU7D ohbsCstL4YabXcgG6Ibi9p7eKaMHWJBjm2OWpWn+O7tZtONQ70F+HDCftXWMHioG3b/B l1vOgth4DPP5Hf9PAgWov4wu9E3ZVdPMT8np6h7fBbfJ1ITVKkyhwlEcrf+BlyWeeA6J nq0yp1kqcYb4Hm3W894qYqghtl5cceL9XHsE2atT0ZnlDTaGKBry1HHYqVioKNlQijBY 2fIR8I066IC2CT2kTLo1YmxqibqIRxJikM8z/M61hmKvjewoh6fEVMb4bMNP+P33gJd4 Icng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=dBrBqtoreAm3njpd2NJwJFQjkt706HaO+uCICQaXGrE=; b=gg9BTMnRkYqRW5Z4cWGuMna9bJGeAyoCRT8GcLGCbX1Mub8ajlXtX5n7QDxhoWHT2o A2CJMCTHObq1m2pxksuMMHe9TsxgA4acYY3OUa3B4zRrRCk+kM2lEMBvio/Y/hkW0JfM iuRNyOyoqLTkR8DQssu+Otm1m8Yz5lBAJvwX5l825XbaP3N4Gf5JpxHV0WhH3PRh9VoZ /gzZrQZ9yA+u2+BYKKxf8kGZjjsV8pb5i+0b+hQjkiQIW4oTBBExACdw8pL8QrpeCiY9 fn00x7tLYZgQApkoplRlcSd1grD90YT1BWNuYzqPjYZjMCRaAP7mxI+csTVtO2oiIj0C xe2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dc10si33766ejb.190.2020.06.17.07.38.42; Wed, 17 Jun 2020 07:39:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726999AbgFQOgz (ORCPT + 99 others); Wed, 17 Jun 2020 10:36:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbgFQOgv (ORCPT ); Wed, 17 Jun 2020 10:36:51 -0400 Received: from baptiste.telenet-ops.be (baptiste.telenet-ops.be [IPv6:2a02:1800:120:4::f00:13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 652CBC061795 for ; Wed, 17 Jun 2020 07:36:50 -0700 (PDT) Received: from ramsan ([IPv6:2a02:1810:ac12:ed20:b57b:2191:a081:571d]) by baptiste.telenet-ops.be with bizsmtp id sEcm2200v1Jlgh201Ecm8N; Wed, 17 Jun 2020 16:36:47 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1jlZBG-0007ps-PW; Wed, 17 Jun 2020 16:36:46 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1jlZBG-0004mU-O3; Wed, 17 Jun 2020 16:36:46 +0200 From: Geert Uytterhoeven To: Yoshinori Sato , Rich Felker Cc: Andrew Morton , Mike Rapoport , Dmitry Safonov <0x7f454c46@gmail.com>, Guenter Roeck , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 4/9] sh: kernel: disassemble: Fix broken lines in disassembly dumps Date: Wed, 17 Jun 2020 16:36:34 +0200 Message-Id: <20200617143639.18315-5-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200617143639.18315-1-geert+renesas@glider.be> References: <20200617143639.18315-1-geert+renesas@glider.be> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rejoin the broken lines by using pr_cont(). Convert the remaining printk() calls to pr_*() while at it. Signed-off-by: Geert Uytterhoeven Tested-by: Guenter Roeck --- v2: - Add Tested-by. Sample impact: Code: - 8c043d00: -bf.s -8c043d08 - - 8c043d02: -tst -r2 -, -r2 - - 8c043d04: -bf -8c043d08 - -->8c043d06: -trapa -#62 - - 8c043d08: -mov.l -8c043d78 -, -r0 - ! 8c044d14 - - 8c043d0a: -mov -r15 -, -r7 - - 8c043d0c: -mov -r13 -, -r6 - - 8c043d0e: -add -#4 -, -r7 - - 8c043d10: -mov -r11 -, -r5 - + 8c043cf4: bf.s 8c043cfc + 8c043cf6: tst r2, r2 + 8c043cf8: bf 8c043cfc +->8c043cfa: trapa #62 + 8c043cfc: mov.l 8c043d6c , r0 ! 8c044d08 + 8c043cfe: mov r15, r7 + 8c043d00: mov r13, r6 + 8c043d02: add #4, r7 + 8c043d04: mov r11, r5 --- arch/sh/kernel/disassemble.c | 103 ++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/arch/sh/kernel/disassemble.c b/arch/sh/kernel/disassemble.c index 845543780cc55014..08e1af63edd9623c 100644 --- a/arch/sh/kernel/disassemble.c +++ b/arch/sh/kernel/disassemble.c @@ -376,148 +376,148 @@ static void print_sh_insn(u32 memaddr, u16 insn) } ok: - printk("%-8s ", op->name); + pr_cont("%-8s ", op->name); lastsp = (op->arg[0] == A_END); disp_pc = 0; for (n = 0; n < 6 && op->arg[n] != A_END; n++) { if (n && op->arg[1] != A_END) - printk(", "); + pr_cont(", "); switch (op->arg[n]) { case A_IMM: - printk("#%d", (char)(imm)); + pr_cont("#%d", (char)(imm)); break; case A_R0: - printk("r0"); + pr_cont("r0"); break; case A_REG_N: - printk("r%d", rn); + pr_cont("r%d", rn); break; case A_INC_N: - printk("@r%d+", rn); + pr_cont("@r%d+", rn); break; case A_DEC_N: - printk("@-r%d", rn); + pr_cont("@-r%d", rn); break; case A_IND_N: - printk("@r%d", rn); + pr_cont("@r%d", rn); break; case A_DISP_REG_N: - printk("@(%d,r%d)", imm, rn); + pr_cont("@(%d,r%d)", imm, rn); break; case A_REG_M: - printk("r%d", rm); + pr_cont("r%d", rm); break; case A_INC_M: - printk("@r%d+", rm); + pr_cont("@r%d+", rm); break; case A_DEC_M: - printk("@-r%d", rm); + pr_cont("@-r%d", rm); break; case A_IND_M: - printk("@r%d", rm); + pr_cont("@r%d", rm); break; case A_DISP_REG_M: - printk("@(%d,r%d)", imm, rm); + pr_cont("@(%d,r%d)", imm, rm); break; case A_REG_B: - printk("r%d_bank", rb); + pr_cont("r%d_bank", rb); break; case A_DISP_PC: disp_pc = 1; disp_pc_addr = imm + 4 + (memaddr & relmask); - printk("%08x <%pS>", disp_pc_addr, - (void *)disp_pc_addr); + pr_cont("%08x <%pS>", disp_pc_addr, + (void *)disp_pc_addr); break; case A_IND_R0_REG_N: - printk("@(r0,r%d)", rn); + pr_cont("@(r0,r%d)", rn); break; case A_IND_R0_REG_M: - printk("@(r0,r%d)", rm); + pr_cont("@(r0,r%d)", rm); break; case A_DISP_GBR: - printk("@(%d,gbr)",imm); + pr_cont("@(%d,gbr)", imm); break; case A_R0_GBR: - printk("@(r0,gbr)"); + pr_cont("@(r0,gbr)"); break; case A_BDISP12: case A_BDISP8: - printk("%08x", imm + memaddr); + pr_cont("%08x", imm + memaddr); break; case A_SR: - printk("sr"); + pr_cont("sr"); break; case A_GBR: - printk("gbr"); + pr_cont("gbr"); break; case A_VBR: - printk("vbr"); + pr_cont("vbr"); break; case A_SSR: - printk("ssr"); + pr_cont("ssr"); break; case A_SPC: - printk("spc"); + pr_cont("spc"); break; case A_MACH: - printk("mach"); + pr_cont("mach"); break; case A_MACL: - printk("macl"); + pr_cont("macl"); break; case A_PR: - printk("pr"); + pr_cont("pr"); break; case A_SGR: - printk("sgr"); + pr_cont("sgr"); break; case A_DBR: - printk("dbr"); + pr_cont("dbr"); break; case FD_REG_N: case F_REG_N: - printk("fr%d", rn); + pr_cont("fr%d", rn); break; case F_REG_M: - printk("fr%d", rm); + pr_cont("fr%d", rm); break; case DX_REG_N: if (rn & 1) { - printk("xd%d", rn & ~1); + pr_cont("xd%d", rn & ~1); break; } /* else, fall through */ case D_REG_N: - printk("dr%d", rn); + pr_cont("dr%d", rn); break; case DX_REG_M: if (rm & 1) { - printk("xd%d", rm & ~1); + pr_cont("xd%d", rm & ~1); break; } /* else, fall through */ case D_REG_M: - printk("dr%d", rm); + pr_cont("dr%d", rm); break; case FPSCR_M: case FPSCR_N: - printk("fpscr"); + pr_cont("fpscr"); break; case FPUL_M: case FPUL_N: - printk("fpul"); + pr_cont("fpul"); break; case F_FR0: - printk("fr0"); + pr_cont("fr0"); break; case V_REG_N: - printk("fv%d", rn*4); + pr_cont("fv%d", rn*4); break; case V_REG_M: - printk("fv%d", rm*4); + pr_cont("fv%d", rm*4); break; case XMTRX_M4: - printk("xmtrx"); + pr_cont("xmtrx"); break; default: return; @@ -532,7 +532,7 @@ static void print_sh_insn(u32 memaddr, u16 insn) else __get_user(val, (u32 *)disp_pc_addr); - printk(" ! %08x <%pS>", val, (void *)val); + pr_cont(" ! %08x <%pS>", val, (void *)val); } return; @@ -541,7 +541,7 @@ static void print_sh_insn(u32 memaddr, u16 insn) } - printk(".word 0x%x%x%x%x", nibs[0], nibs[1], nibs[2], nibs[3]); + pr_info(".word 0x%x%x%x%x", nibs[0], nibs[1], nibs[2], nibs[3]); } void show_code(struct pt_regs *regs) @@ -552,20 +552,21 @@ void show_code(struct pt_regs *regs) if (regs->pc & 0x1) return; - printk("Code:\n"); + pr_info("Code:\n"); for (i = -3 ; i < 6 ; i++) { unsigned short insn; if (__get_user(insn, pc + i)) { - printk(" (Bad address in pc)\n"); + pr_err(" (Bad address in pc)\n"); break; } - printk("%s%08lx: ", (i ? " ": "->"), (unsigned long)(pc + i)); + pr_info("%s%08lx: ", (i ? " " : "->"), + (unsigned long)(pc + i)); print_sh_insn((unsigned long)(pc + i), insn); - printk("\n"); + pr_cont("\n"); } - printk("\n"); + pr_info("\n"); } -- 2.17.1