Message ID | 20231101115206.70810-1-james.clark@arm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:abcd:0:b0:403:3b70:6f57 with SMTP id f13csp356200vqx; Wed, 1 Nov 2023 04:52:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyVWpBzRf41kl9iQBaDfUJT0e3uUVQg4VjqCU0xah13qAh6gYUDD4XmTIkkgYxwHSgDaWO X-Received: by 2002:a05:6300:8003:b0:181:5f5:1193 with SMTP id an3-20020a056300800300b0018105f51193mr4440824pzc.35.1698839564044; Wed, 01 Nov 2023 04:52:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698839564; cv=none; d=google.com; s=arc-20160816; b=w1pWC3EiL+bM/L8O2vQhHUn6QJC35kW40ob41glhXcxGtQw0Jw0dimv9R37ffjViWK LsfHcH82qv+WvrlVqqHJx06JPmO+43TfncK5fevTj6dofcYUvP3HSrzfWfN9G/4pYBRu MazPQJwFr/RwV0w/DInltaCPJOIIlRvTfncKzTmgn3SytFQLPvkUMXZBY3mz8oUztj2A Njf+rcwSYoDY76jTaBIp2SOpdmTronSREpbqwkZ5boG7yE3Z247Jx05KbPxTjQQ0CF+c kOB3KZtQ0ZspBghLvXlIl6ER6Vlsz3AmE2SjZhV8v3j9OT5B96Sn82dzV/XA9p7QKBaM BiWg== 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 :message-id:date:subject:cc:to:from; bh=uv/cV8r2c2bmDEeELYJrYvSFiDTnJ95Qdeg04+l70VY=; fh=q4AlezUzVIEhfhbU9cgbcsdbcUROMSyAiJOdXRtqQpg=; b=Sa7fpu+Dbv1osaEjL7loQf7u7VXY7IYuwHYX7hVyKlVuuBimbQedl20ZRQREAGxYh8 kysLWdozXokmHKDnCXVQFrn+9ylQ+YVQ8cMV7rbKeewNSRUsCe6cgV6lJ6UB+G1BNJpT pcdRpNUSlZGzlysxWUZXRX6kj8b8j94cmffGXq3tkdkKOOSGvo0P/CsLHCkXSwV+CQ1E dTk1iKT/kZuh77kJ1q+3kBEfwovRxPBIF5KfI5/6c+mMeQtwfvhbWBRVV8Kn87oRO3rJ 5mfleqWlmCCVJcT8uabc4beHphTSkFvT6jRdTxoKIv+j/OYhVwWxY15ZB78gEQWU9Ioi PhJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id ay2-20020a17090b030200b0026305080a6fsi655234pjb.63.2023.11.01.04.52.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 04:52:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E883B804C609; Wed, 1 Nov 2023 04:52:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235369AbjKALwa (ORCPT <rfc822;rbbytesnap@gmail.com> + 35 others); Wed, 1 Nov 2023 07:52:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231538AbjKALw3 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 1 Nov 2023 07:52:29 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CD18BDC; Wed, 1 Nov 2023 04:52:26 -0700 (PDT) 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 47ADF2F4; Wed, 1 Nov 2023 04:53:08 -0700 (PDT) Received: from e127643.broadband (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7E1783F67D; Wed, 1 Nov 2023 04:52:23 -0700 (PDT) From: James Clark <james.clark@arm.com> To: coresight@lists.linaro.org, suzuki.poulose@arm.com, anshuman.khandual@arm.com, mike.leach@linaro.org Cc: James Clark <james.clark@arm.com>, stable@vger.kernel.org, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Pratik Patel <pratikp@codeaurora.org>, Mathieu Poirier <mathieu.poirier@linaro.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Kaixu Xia <xiakaixu@huawei.com>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] coresight: etm4x: Fix width of CCITMIN field Date: Wed, 1 Nov 2023 11:52:06 +0000 Message-Id: <20231101115206.70810-1-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 01 Nov 2023 04:52:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781362394925428063 X-GMAIL-MSGID: 1781362394925428063 |
Series |
[v2] coresight: etm4x: Fix width of CCITMIN field
|
|
Commit Message
James Clark
Nov. 1, 2023, 11:52 a.m. UTC
CCITMIN is a 12 bit field and doesn't fit in a u8, so extend it to u16. This probably wasn't an issue previously because values higher than 255 never occurred. But since commit 0f55b43dedcd ("coresight: etm: Override TRCIDR3.CCITMIN on errata affected cpus"), a comparison with 256 was done to enable the errata, generating the following W=1 build error: coresight-etm4x-core.c:1188:24: error: result of comparison of constant 256 with expression of type 'u8' (aka 'unsigned char') is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (drvdata->ccitmin == 256) Cc: stable@vger.kernel.org Fixes: 2e1cdfe184b5 ("coresight-etm4x: Adding CoreSight ETM4x driver") Reviewed-by: Mike Leach <mike.leach@linaro.org> Signed-off-by: James Clark <james.clark@arm.com> --- Changes since V1: * Change the fixes commit to the original addition of ccitmin, rather than the last refactor of the struct. drivers/hwtracing/coresight/coresight-etm4x.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 01/11/2023 11:52, James Clark wrote: > CCITMIN is a 12 bit field and doesn't fit in a u8, so extend it to u16. > This probably wasn't an issue previously because values higher than 255 > never occurred. > > But since commit 0f55b43dedcd ("coresight: etm: Override TRCIDR3.CCITMIN > on errata affected cpus"), a comparison with 256 was done to enable the > errata, generating the following W=1 build error: > > coresight-etm4x-core.c:1188:24: error: result of comparison of > constant 256 with expression of type 'u8' (aka 'unsigned char') is > always false [-Werror,-Wtautological-constant-out-of-range-compare] > > if (drvdata->ccitmin == 256) > > Cc: stable@vger.kernel.org > Fixes: 2e1cdfe184b5 ("coresight-etm4x: Adding CoreSight ETM4x driver") > Reviewed-by: Mike Leach <mike.leach@linaro.org> > Signed-off-by: James Clark <james.clark@arm.com> Thanks, applied to coresight next : Suzuki
diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h index 20e2e4cb7614..da17b6c49b0f 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.h +++ b/drivers/hwtracing/coresight/coresight-etm4x.h @@ -1036,7 +1036,7 @@ struct etmv4_drvdata { u8 ctxid_size; u8 vmid_size; u8 ccsize; - u8 ccitmin; + u16 ccitmin; u8 s_ex_level; u8 ns_ex_level; u8 q_support;