Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp237475imm; Fri, 21 Sep 2018 13:28:04 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaH+UEzufxmGKyjdm8D5itr2YFdDiQldwH6ZeVl0S22A8Z8lR8+5LXVwwyKOUC40jxbG00/ X-Received: by 2002:a63:804a:: with SMTP id j71-v6mr42599031pgd.171.1537561684893; Fri, 21 Sep 2018 13:28:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537561684; cv=none; d=google.com; s=arc-20160816; b=aWcsbB48caFaE3dr3LJsNwNzLCXI48iz4kmbEvts81C309NFFVYsvG28xEvQ7U6qW3 a4rAacKgamXhGi6bPwuyYU9Abvcd7TuCE54yWamqufdBA2DEWaf1lz3OOIXzx23ftrNY QCXZHRHAUK//ofN46V7y8ph6JdqUztI6NqaN32Lp6cPtz73BIaoj1kK+tdqCw8kqN/jq TE7B8HimGLoZYTGeOGzN+NNc1l/BgQBMLSUULBHQo0cjb76LXyyawnH5vKOdL3Nnkmxh TFGdn9IoGZt0v8+cweWzDgb5PlQwFyMMUgDmK/wiPPFsbhWpjbKH6TCDG7UU+WTffAyG nf+g== 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; bh=r347ljaT5tm8YjLgNuMDic9uaYSR8zo5Pa1l72503XI=; b=XiXw+lSqfJM6Y6HKz4i7EurozKyBIA4YbK6ifMDeqZI5sZZBJMBKGLOd57yo3XeWEo CiB1lrFjxftevM3PKu4ix4DDRQ+/QSRWYu0Wk0IxRkUbTnObCM7DPog9YDxlzjbjYJeT 3G08XDqdTVTjcvl7HggmvuOsDCiItZ0dIb1b7DOkpQCilsP3V8ZlkleNhg3m3xkl190g 9DwvOcFK4RM2Aa7wHq6PTTc43aFAjZaYj30pRQLPHA7Jl9Xdz5Wlt44tdksoNE68iRyV wF5U1Oo4OteiupKZl172oyomRszHSv0EiHGuVtPg1BW2UXThVA/Z+DjeIHbcpN2qpBjH PQIQ== 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 s36-v6si28202637pld.8.2018.09.21.13.27.49; Fri, 21 Sep 2018 13:28:04 -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 S2391419AbeIVCQU (ORCPT + 99 others); Fri, 21 Sep 2018 22:16:20 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36246 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2391318AbeIVCQU (ORCPT ); Fri, 21 Sep 2018 22:16:20 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8LKODvI130989 for ; Fri, 21 Sep 2018 16:25:49 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0b-001b2d01.pphosted.com with ESMTP id 2mn60r3mqe-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 21 Sep 2018 16:25:49 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 21 Sep 2018 14:25:48 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 21 Sep 2018 14:25:46 -0600 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8LKPjPM45744204 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 21 Sep 2018 13:25:45 -0700 Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6FF56C605D; Fri, 21 Sep 2018 14:25:45 -0600 (MDT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C11E9C6055; Fri, 21 Sep 2018 14:25:44 -0600 (MDT) Received: from localhost (unknown [9.80.102.110]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTPS; Fri, 21 Sep 2018 14:25:44 -0600 (MDT) Date: Fri, 21 Sep 2018 17:25:40 -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 v3 3/3] powerpc/process: Constify the number of insns printed by show instructions functions. References: <113d4a559f6eec448b253bf5f0b4f2a8ffb187af.1536327756.git.christophe.leroy@c-s.fr> <3fdf75eed98b1fa22da77e675692a86a7a9986a7.1536327756.git.christophe.leroy@c-s.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3fdf75eed98b1fa22da77e675692a86a7a9986a7.1536327756.git.christophe.leroy@c-s.fr> User-Agent: Mutt/1.10.1 (2018-07-13) X-TM-AS-GCONF: 00 x-cbid: 18092120-8235-0000-0000-00000E04333D X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009747; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01091682; UDB=6.00564082; IPR=6.00871706; MB=3.00023441; MTD=3.00000008; XFM=3.00000015; UTC=2018-09-21 20:25:48 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18092120-8236-0000-0000-000042B9A78B Message-Id: <20180921202540.GC19940@kermit-br-ibm-com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-21_08:,, 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-1809210197 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 07, 2018 at 01:47:33PM +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 > --- > 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 > -- Murilo