Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2260693pxm; Fri, 4 Mar 2022 12:33:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxi4DzTHccC+UFVUC5eXPb58B2i4yv5174ITMZdzL5xd6b2XRWqjcz2xArAaO4Q8n1VE9JR X-Received: by 2002:a63:7d49:0:b0:378:907d:1fc7 with SMTP id m9-20020a637d49000000b00378907d1fc7mr158800pgn.252.1646425995945; Fri, 04 Mar 2022 12:33:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646425995; cv=none; d=google.com; s=arc-20160816; b=UUdesM4xm1OPMGTDAC/MFke9FYf4IwuzFrvLxj3sBudScFElbg27cpGQXIuvlS7z2y cE4FH0wzLoNd8607lR4WwM4Fa3DTGIIWL5nI2iNhzSdXLij+5Ownxqxv87gwImB3OFWK d4DeuVqNAkkOYYHewHkvKwKxhGLJo6mX5eLk4z2h8YRkNz7dsa4NDU5MHYUdrNAB+XiR 7yC9t1Gr4aBxfplHTCD4KFqS6Yw6fM+F+AOfi6SP5/KUCJcvtcKOHk5wwcz2d9KwDAjS krWkzs6/PnbEDdYK5CuWB5eESLRiU23oJHExPSsuTHx1Zfv2IJr5Xmj521SHwOpvEvyp DF2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=asO0KtvQtjosNI9v4Njx9TrundjMLgCWZd01T4mp2Hc=; b=XBpJhRb2vosUlaYxsem6cypbckWYotCH2T4ZU5qr8r7jll5hvB1fyEwJKvgRgZPc+g BIHNJGrA7/ywoLRzEhKyBjxNtHaE0PyBJbJ7v5Ho5U7Z3dcyBc+UnIRc5Zj+/KIfx/WU GvTifisUjwP3DfjTW6FpUQoBbKISnSifRrDm+ZdFnyw7SdEFnU/g9j7XLdSSiDZ/dTZn Y7m+CXbq1kUSOKEILfQoiZxrA3GY9YaIrQQFI/SyLThzvp31qRK//S48fdm7a/CrF4kT dqtXtcjzeZu+o1xTnJWJEXNmZ44ZIC8cu3zScKpiMrZJNvHdLMzAJksWP5MIoLTiKQ79 7sVw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id z6-20020a056a00240600b004f1151f1919si5853371pfh.57.2022.03.04.12.33.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 12:33:15 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9DDA921DF3C; Fri, 4 Mar 2022 11:37:25 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241104AbiCDRVM (ORCPT + 99 others); Fri, 4 Mar 2022 12:21:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241081AbiCDRU6 (ORCPT ); Fri, 4 Mar 2022 12:20:58 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 187071520C2 for ; Fri, 4 Mar 2022 09:20:02 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D97C51424; Fri, 4 Mar 2022 09:20:01 -0800 (PST) Received: from e121896.arm.com (unknown [10.57.42.166]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 425303F73D; Fri, 4 Mar 2022 09:20:00 -0800 (PST) From: James Clark To: suzuki.poulose@arm.com, coresight@lists.linaro.org, mike.leach@linaro.org, anshuman.khandual@arm.com Cc: mathieu.poirier@linaro.org, leo.yan@linaro.com, James Clark , Leo Yan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 15/15] coresight: etm4x: Cleanup TRCRSCTLRn register accesses Date: Fri, 4 Mar 2022 17:19:12 +0000 Message-Id: <20220304171913.2292458-16-james.clark@arm.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20220304171913.2292458-1-james.clark@arm.com> References: <20220304171913.2292458-1-james.clark@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a no-op change for style and consistency and has no effect on the binary output by the compiler. In sysreg.h fields are defined as the register name followed by the field name and then _MASK. This allows for grepping for fields by name rather than using magic numbers. Signed-off-by: James Clark --- drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 7 +++++-- drivers/hwtracing/coresight/coresight-etm4x.h | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c index 3ae6f4432646..6ea8181816fc 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c @@ -1726,8 +1726,11 @@ static ssize_t res_ctrl_store(struct device *dev, /* For odd idx pair inversal bit is RES0 */ if (idx % 2 != 0) /* PAIRINV, bit[21] */ - val &= ~BIT(21); - config->res_ctrl[idx] = val & GENMASK(21, 0); + val &= ~TRCRSCTLRn_PAIRINV; + config->res_ctrl[idx] = val & (TRCRSCTLRn_PAIRINV | + TRCRSCTLRn_INV | + TRCRSCTLRn_GROUP_MASK | + TRCRSCTLRn_SELECT_MASK); spin_unlock(&drvdata->spinlock); return size; } diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h index 15704982357f..2c412841b126 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.h +++ b/drivers/hwtracing/coresight/coresight-etm4x.h @@ -223,6 +223,13 @@ #define TRCBBCTLR_MODE BIT(8) #define TRCBBCTLR_RANGE_MASK GENMASK(7, 0) +#define TRCRSCTLRn_PAIRINV BIT(21) +#define TRCRSCTLRn_INV BIT(20) +#define TRCRSCTLRn_GROUP_MASK GENMASK(19, 16) +#define TRCRSCTLRn_SELECT_MASK GENMASK(15, 0) + + + /* * System instructions to access ETM registers. * See ETMv4.4 spec ARM IHI0064F section 4.3.6 System instructions -- 2.28.0