Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3296155ybi; Mon, 17 Jun 2019 21:28:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+gMfphS3Z+Isc61pP+sNHhx5pw5Tf/OzqzFwSq0Lgvc7A+2Zt2iWjd6oG5Z9JaqvZHj8V X-Received: by 2002:a17:90a:aa0d:: with SMTP id k13mr2729415pjq.53.1560832123686; Mon, 17 Jun 2019 21:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560832123; cv=none; d=google.com; s=arc-20160816; b=QwKrh2pKKoF4YD7t3BNK6z9aaIMIUixs5k3a3o0BnDyK7Dz7S1l3ljxT2VODLQG7/H Nn0hcDzLFBgmRSuIcz0knsK3cvX88JSZwR8ix4/3q9m+QJv0hX7P4rdS7uNb1SXCh0xh g2/X9eUvN9EKWJ8Piw3ASj2JqdpOcxpQyEXHEjXY31x+FTtoHb8FnocRV6c3HqMVcMnS TWWvU5c1JQsTivFnnh9cAto8SnkocKlcLUyeIGUV45ZEsGH3ZXWi39wqGBM8Id8yBzGz IY0XLSSooTBYV9DiKmdx49pQCPnhQMlweyWxy+10LMQmbcYJh/P+9CraUP6VC+/hGpaL nyag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:cc:to:from; bh=PQhdbzcgcymf3lfMUayPbZf4zg7xD0a+FfdMgrY4eNM=; b=g0F0zuJOR+OmiW+c/RhvGXFvyJ+QKEBw4yXIKGzYGYaLbn0xYFbCA8LL3lmYjHpSfj pDVoee574qBvM7f4uAUs9GWHnNuB7tp1BGMUntftHoGFrYNeYmoET9DT20rHvOphtLEh QvOJG7mUHxj3pWw3H7coraZJVOC7frLvrRbAbDHhb3iXq5UKB9WIDDIljEkhtGCa6KV5 mkROhmQLj8LCoYIJCNl3BSytKJW8KbprlUdB7miSIKSGKzPmcAB2pqi3dIQ2JtxCZjBQ xsKr+VCgr7r3MufnJbWJWNb5QxeB1+knvA/susduWmG2sdqZ6LX9rmvMa4PWvl8F/EIn 820A== 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 34si12559868plp.305.2019.06.17.21.28.28; Mon, 17 Jun 2019 21:28:43 -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 S1728565AbfFRE15 (ORCPT + 99 others); Tue, 18 Jun 2019 00:27:57 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:24776 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725826AbfFRE14 (ORCPT ); Tue, 18 Jun 2019 00:27:56 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5I4RFA5114262 for ; Tue, 18 Jun 2019 00:27:56 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2t6pbqvnn7-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 18 Jun 2019 00:27:55 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 18 Jun 2019 05:27:53 +0100 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 18 Jun 2019 05:27:49 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x5I4Rmcs37224744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2019 04:27:49 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D6DCB11C050; Tue, 18 Jun 2019 04:27:48 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0274D11C04C; Tue, 18 Jun 2019 04:27:46 +0000 (GMT) Received: from bangoria.ibmuc.com (unknown [9.199.63.86]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 18 Jun 2019 04:27:45 +0000 (GMT) From: Ravi Bangoria To: mpe@ellerman.id.au Cc: benh@kernel.crashing.org, paulus@samba.org, mikey@neuling.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, npiggin@gmail.com, christophe.leroy@c-s.fr, naveen.n.rao@linux.vnet.ibm.com, Ravi Bangoria Subject: [PATCH 3/5] Powerpc/hw-breakpoint: Refactor set_dawr() Date: Tue, 18 Jun 2019 09:57:30 +0530 X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190618042732.5582-1-ravi.bangoria@linux.ibm.com> References: <20190618042732.5582-1-ravi.bangoria@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19061804-0020-0000-0000-0000034AFDFE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061804-0021-0000-0000-0000219E4884 Message-Id: <20190618042732.5582-4-ravi.bangoria@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-06-18_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=923 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906180035 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove unnecessary comments. Code itself is self explanatory. And, ISA already talks about MRD field. I Don't think we need to re-describe it. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/process.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index f0fbbf6a6a1f..f002d2ffff86 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -799,18 +799,11 @@ int set_dawr(struct arch_hw_breakpoint *brk) dawr = brk->address; - dawrx = (brk->type & (HW_BRK_TYPE_READ | HW_BRK_TYPE_WRITE)) \ - << (63 - 58); //* read/write bits */ - dawrx |= ((brk->type & (HW_BRK_TYPE_TRANSLATE)) >> 2) \ - << (63 - 59); //* translate */ - dawrx |= (brk->type & (HW_BRK_TYPE_PRIV_ALL)) \ - >> 3; //* PRIM bits */ - /* dawr length is stored in field MDR bits 48:53. Matches range in - doublewords (64 bits) baised by -1 eg. 0b000000=1DW and - 0b111111=64DW. - brk->len is in bytes. - This aligns up to double word size, shifts and does the bias. - */ + dawrx = (brk->type & HW_BRK_TYPE_RDWR) << (63 - 58); + dawrx |= ((brk->type & HW_BRK_TYPE_TRANSLATE) >> 2) << (63 - 59); + dawrx |= (brk->type & HW_BRK_TYPE_PRIV_ALL) >> 3; + + /* brk->len is in bytes. */ mrd = ((brk->len + 7) >> 3) - 1; dawrx |= (mrd & 0x3f) << (63 - 53); -- 2.20.1