Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1964542imm; Fri, 7 Sep 2018 08:46:50 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZ58wFNCVpd9NybkKO3biquyrdrGPuzthEaE/DOaRbbsK06ykwvhbi7HcBJtB/7bRFojsmN X-Received: by 2002:a65:608b:: with SMTP id t11-v6mr9009672pgu.259.1536335210648; Fri, 07 Sep 2018 08:46:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536335210; cv=none; d=google.com; s=arc-20160816; b=AXCoDs16Z2LxW7M9pm3kHDKW1tZ6CieKdgv4+AIaMxIyedI7JFv1GPvDRRpFCsZqkp 4AaUUnakvOBUip8ouEhsltmvzn3/J1M0VHME6S13O6GUKLREnS3BhIcP1VVA+mXC7FUP yaDiy6zYS1Ycp8RYiE2WnWydqf7FjTStQz29rctUsSoUdLT/s1mmEm74OR2zl7ceQ2hc mc/d56HQrQev+HYm085tmruFFcEje3Kbx8iN5HELl/XWsoIV9QTImSeZJFU/TbJowe7z UC5qz9VJC1DzRsAkizphePdCueCwP1s0v1BBUvJ0SE8QMEbPYJ/0cyKFgIMwwHm4nzdk GrzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id; bh=qOLYy+BHs7Gx5swPailqYCWdkW/p4P+OkagosZ9IaCg=; b=fnoZgswV7bU6On8qPr4sCF0eSVaKT3ubXPw+rsoKDbM6FAP2qYSX9GHrecob8bBW0P dqdf0Z+PRiTzItQ7KplBoT2NXUMvF6Aef4vyTzQJJze0btzFkFb2SDUTRYQ+jl8OdzoO yXZZExG1uPmSPIWgM9EI0XzaxTZCFv43BYvj+Q8Ye0ffnKaaVqiO3DZYLv6c7xhQO5OC b3dgAXqT6/4B2F2VGPMZJJcyQkNdR1eyGY7STTMTHyk0a9b9je+xAQvkK4qXtonBpi+8 e2zdCd8dIIABlc+oVP4Riy6FnBYWmA8EJ3QR+0xUy44yBF6eYtdHdhfKIC6oQtcYebsh DyQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 88-v6si9315183plc.515.2018.09.07.08.46.35; Fri, 07 Sep 2018 08:46:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729769AbeIGS2h (ORCPT + 99 others); Fri, 7 Sep 2018 14:28:37 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:17587 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728460AbeIGS2g (ORCPT ); Fri, 7 Sep 2018 14:28:36 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 426JfB0X0Hz9ttFX; Fri, 7 Sep 2018 15:47:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id YcvTp5ZlUsZ3; Fri, 7 Sep 2018 15:47:30 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 426JfB041Yz9ttFK; Fri, 7 Sep 2018 15:47:30 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B7E888B950; Fri, 7 Sep 2018 15:47:33 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id YAXfxmMln7XO; Fri, 7 Sep 2018 15:47:33 +0200 (CEST) Received: from pc16082vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 9AA9A8B94C; Fri, 7 Sep 2018 15:47:33 +0200 (CEST) Received: by pc16082vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 920BC718AB; Fri, 7 Sep 2018 13:47:33 +0000 (UTC) Message-Id: <3fdf75eed98b1fa22da77e675692a86a7a9986a7.1536327756.git.christophe.leroy@c-s.fr> In-Reply-To: <113d4a559f6eec448b253bf5f0b4f2a8ffb187af.1536327756.git.christophe.leroy@c-s.fr> References: <113d4a559f6eec448b253bf5f0b4f2a8ffb187af.1536327756.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH v3 3/3] powerpc/process: Constify the number of insns printed by show instructions functions. To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , muriloo@linux.ibm.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Fri, 7 Sep 2018 13:47:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org instructions_to_print var is assigned value 16 and there is no way to change it. This patch replaces it by a constant. Signed-off-by: Christophe Leroy --- v3: no change v2: no change arch/powerpc/kernel/process.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 2a39f7aca846..7d86b4f7949e 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -1261,17 +1261,16 @@ struct task_struct *__switch_to(struct task_struct *prev, return last; } -static int instructions_to_print = 16; +#define NR_INSN_TO_PRINT 16 static void show_instructions(struct pt_regs *regs) { int i; - unsigned long pc = regs->nip - (instructions_to_print * 3 / 4 * - sizeof(int)); + unsigned long pc = regs->nip - (NR_INSN_TO_PRINT * 3 / 4 * sizeof(int)); printk("Instruction dump:"); - for (i = 0; i < instructions_to_print; i++) { + for (i = 0; i < NR_INSN_TO_PRINT; i++) { int instr; if (!(i % 8)) @@ -1304,11 +1303,11 @@ static void show_instructions(struct pt_regs *regs) void show_user_instructions(struct pt_regs *regs) { unsigned long pc; - int n = instructions_to_print; + int n = NR_INSN_TO_PRINT; struct seq_buf s; char buf[96]; /* enough for 8 times 9 + 2 chars */ - pc = regs->nip - (instructions_to_print * 3 / 4 * sizeof(int)); + pc = regs->nip - (NR_INSN_TO_PRINT * 3 / 4 * sizeof(int)); seq_buf_init(&s, buf, sizeof(buf)); -- 2.13.3