Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp721367imm; Fri, 17 Aug 2018 05:41:05 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzJNDgrN6WDXAnHoz35vrkyhKYK+gv6StqKyvsYbTNBVVIAL55FzhaH+ut+KObgtqNfIB7p X-Received: by 2002:a65:41c6:: with SMTP id b6-v6mr32547888pgq.174.1534509665639; Fri, 17 Aug 2018 05:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534509665; cv=none; d=google.com; s=arc-20160816; b=A0ajjh0JCYer9LtvEgXQ+YOW1hJ+PTWJWMhHeSbph0VourPggb6QeOjDk/O12QyPcl wfKPBcu+PuKQz8ecb0ykeuuyNC0MLBcRgVv7ziuAFy8m+YpAR11av6Z4bmrU8UWxFp4r FVUV+ItOxcYN9J/Cyz6nWlRsV3iQU+7rnA86Yk6yJbKYpjHxpn/FKjWOvIU2PnPvzX3Y Nhy9m7jXdQs0/608oWSqa/WUYxjhzE0jjzCzu1yYkHw+Uq9rW4p4oSWIZvt6wRBrfjs1 6K5p/q21IWQH8F5QiAmO552QIDC1K+6P2ldmWuB5CDXzVEarKnO/1NUcH1EKY8EXM3EX dffQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date :arc-authentication-results; bh=qTpKgLwRkj88XjkxRXG3J8WMf1v3JJEeFBM9VYKvvM8=; b=khRqQa97KMemTFTqQt0VIsGZ87QIlHxZ9Y5ej1oBNJbQU5LwrbWnmQAN1yLkYce+Ca M/pCFCMhIBVybhBsIxpjAxJkXl343JKVS2VnSXpWkB0x8dTmqb3DYga1RKFY4vsjDKni MHWOK3VRozg+E1T6/N7uKapVnV7D/W2jSprQoSzLAZB3Ps080gO6Rr3OUkmhFGiVZSxT 1t8caAjlBpXj/m/FDMXG4zSliputK9iRy21YFQijaiU72k1ThYS4sVhmwe9i9QV1Vybm dOebbUuxgHYSBMEEPFl/fwhClpdRTmYC492Zp0qes7h185byVvSo5H0hnHxDQ7V1cZQh lEGg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k62-v6si2262739pfk.199.2018.08.17.05.40.50; Fri, 17 Aug 2018 05:41:05 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727131AbeHQPnA (ORCPT + 99 others); Fri, 17 Aug 2018 11:43:00 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:42010 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbeHQPnA (ORCPT ); Fri, 17 Aug 2018 11:43:00 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7HCcc8s102143 for ; Fri, 17 Aug 2018 08:39:42 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0a-001b2d01.pphosted.com with ESMTP id 2kwvb5w6y7-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 Aug 2018 08:39:42 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 17 Aug 2018 08:39:41 -0400 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 17 Aug 2018 08:39:38 -0400 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w7HCdbUx15597680 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Aug 2018 12:39:37 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 784B2AC05F; Fri, 17 Aug 2018 08:39:55 -0400 (EDT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A999AAC05E; Fri, 17 Aug 2018 08:39:54 -0400 (EDT) Received: from localhost (unknown [9.80.100.14]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTPS; Fri, 17 Aug 2018 08:39:54 -0400 (EDT) Date: Fri, 17 Aug 2018 09:39:34 -0300 From: Murilo Opsfelder Araujo To: Christophe Leroy Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 2/2] powerpc/process: Constify the number of insns printed by show instructions functions. References: <718cc9c9bd1d4bb2b4c2596f1a7ee00334e77055.1534192631.git.christophe.leroy@c-s.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 x-cbid: 18081712-0060-0000-0000-0000029F94E7 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009560; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01074817; UDB=6.00553923; IPR=6.00854776; MB=3.00022773; MTD=3.00000008; XFM=3.00000015; UTC=2018-08-17 12:39:40 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18081712-0061-0000-0000-00004632B238 Message-Id: <20180817123934.GB7458@kermit-br-ibm-com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-17_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808170139 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Christophe. On Tue, Aug 14, 2018 at 08:59:20AM +0000, Christophe Leroy wrote: > 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 Reviewed-by: Murilo Opsfelder Araujo > --- > 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 > -- Murilo