Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4168130ooa; Tue, 14 Aug 2018 02:01:46 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzHDtRZWZfrDV9Nyd7qt9KxFCaM4PX5ExCa+2vzufJ+aJXWbdCurJNPLJCwxDOYD6HT9HML X-Received: by 2002:a63:144b:: with SMTP id 11-v6mr20696345pgu.219.1534237306203; Tue, 14 Aug 2018 02:01:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534237306; cv=none; d=google.com; s=arc-20160816; b=fTLR0hO+fw7+wijs768s0VoqeRy9OZUV7CojBuaIzECJE87+pT23VaURg1RsES4AEL rEYehhRaxpgxTUyJb4J5UTLJjAy9j1XGRELz3gBMCxivalaQlQ1wgRR41H3MuOuuAkhe PcWv6TphDrDB4MrJOuZxv2+RqZmfKTdkqo+Mo3vYXaSaEZtJHeWtRr0QBUKjunwnYJ8y sRt8laCdUfVaGfmT/gjzLRo7WtISuLNb5lNPioDVYaxsfSIBvJO0lbKhBBI/0Fz36otG 4tFtZZilPhVO4eQ8ZEe+p/d8qSk2b+6BVOlSLife/HqHn5ywodRGZR+UVDOKqqA2Y5TH O1Zw== 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:arc-authentication-results; bh=UuRWlXZ/UUfshXXCHS5qt2hyGcdkC/6BJh96VrNBG4c=; b=f7uF5yLtjrPV29LVGQZFjAE/5ETMGEmBFmc1mFMVZBORq6ALja3zQKnnGMPSDUYlwD 1fCLFETGLYsSrfxPoJpP1fEdEa1ye4fLjVXAN6uKjwh9zqaANaTcEIKFqui5Sioi+MM0 gndYT8lsTg/3G4wFYw7Qmidx0pMfJWoThMIVJeM8iD80XWhcZ2xLa+6iS0qZpcgkPe98 kAb5A9bBHyTE6Uje8M6510YBzvpzZMZ8IGI/GmNUxrHjHybvHCod3aGr8HdiGFf7+6l9 iC+iemng4t7Kl6xFSrWHC7+03f7tGwXpgYitp4lgH0/ioy9jLgI7Q0/eMNgjCb0kG7UE 6V4w== 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 s9-v6si18234859pgk.384.2018.08.14.02.01.29; Tue, 14 Aug 2018 02:01:46 -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 S1731957AbeHNLph (ORCPT + 99 others); Tue, 14 Aug 2018 07:45:37 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:40159 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730119AbeHNLpg (ORCPT ); Tue, 14 Aug 2018 07:45:36 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 41qRNk6h7jz9tvSH; Tue, 14 Aug 2018 10:59:18 +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 zI4MD5WR5Tw6; Tue, 14 Aug 2018 10:59:18 +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 41qRNk67Tyz9tvS6; Tue, 14 Aug 2018 10:59:18 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id DD48B8B79E; Tue, 14 Aug 2018 10:59:20 +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 W_nhnsqY8Q6r; Tue, 14 Aug 2018 10:59:20 +0200 (CEST) Received: from pc16082vm.idsi0.si.c-s.fr (unknown [192.168.232.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B31738B74B; Tue, 14 Aug 2018 10:59:20 +0200 (CEST) Received: by pc16082vm.idsi0.si.c-s.fr (Postfix, from userid 0) id C778D71283; Tue, 14 Aug 2018 08:59:20 +0000 (UTC) Message-Id: In-Reply-To: <718cc9c9bd1d4bb2b4c2596f1a7ee00334e77055.1534192631.git.christophe.leroy@c-s.fr> References: <718cc9c9bd1d4bb2b4c2596f1a7ee00334e77055.1534192631.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH 2/2] 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: Tue, 14 Aug 2018 08:59:20 +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 --- 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 c722ce4ca1c0..6317f2ed04ab 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -1259,17 +1259,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)) @@ -1306,9 +1305,9 @@ void show_user_instructions(struct pt_regs *regs) char buf[96]; /* enough for 8 times 9 + 2 chars */ int l = 0; - pc = regs->nip - (instructions_to_print * 3 / 4 * sizeof(int)); + pc = regs->nip - (NR_INSN_TO_PRINT * 3 / 4 * sizeof(int)); - for (i = 0; i < instructions_to_print; i++) { + for (i = 0; i < NR_INSN_TO_PRINT; i++) { int instr; if (!(i % 8) && (i > 0)) { -- 2.13.3