Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5916201rwd; Mon, 5 Jun 2023 10:11:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ59PLBgs/ye9gjNEGTXsPnjIVucPrhtlCOvIl4C4l/BLR76WTHUJbgS+qZOad78h5HHQmVR X-Received: by 2002:a05:6a20:7f8a:b0:113:fe95:da8c with SMTP id d10-20020a056a207f8a00b00113fe95da8cmr3554487pzj.14.1685985079834; Mon, 05 Jun 2023 10:11:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685985079; cv=none; d=google.com; s=arc-20160816; b=y4q1wFyMkVoil8rUPMiON/CcYPg5GdgiEaiuBvbZRnU87i0ScCvaRDDoSC72G3a3Dv RQ06JRW/eCKMyTOmN+NY+tQAN/Feacx0odiEtz7YCetAAutpEnjPQ7uc0f8kbzr7Uor3 dLRu3exwLFujK9zKEDbPt+d7xtmVxPr7jkyb+63QnhguwbMTYY/Bqfdx5rUy3SP3LHD+ SWVxmy8OMx4UT3a84nOQzsOm4P0Ch59mx8FlyssqcKWXHMiEZDfKvWGQOXJV27AwAvSK 7GG0duDP8hnD5ViIO8D0RZtVCey15o5N+Bkg7KpxmL3peonyCDnQVLjFlgBWh3Xe2A6i MddA== 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=b6DYqpoLQ3wmrXzODHSW39wqOGmaf4tRFk+i/AUwD3o=; b=Xk8u3nbkNiPgk/UMgpvbPqzX/eThN1MgkGmvlVkf2EoiaFRhiQ7FLXCSNE5tD9kJWg 25AOwfbVXPVTtVNAr+e0/kVE+nhk30k+gjsKDgazeCBtYLtLuhI1h3MONDhCvHPVpq9O 6Zcapk9lQA1TxKjJL0CsGtoH2C9PgDRfXXXEBhnNqNx14II5vIKKfnDtGm/GcO3P1XTK AwCTScI2T0w6lFzeDMidxkSlKKJ0fONzxwhpXVLIRSHLwG9sHBA1mRE7NfBHISF5uikV aGQYS6FLFd6yC7Nz7GzR1wRBd2K/bqHnNaUl3gb2IO03NvRVjsi2/TKMS4sqjDWUBEsW cb6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d4-20020aa797a4000000b00648019bae38si5495269pfq.277.2023.06.05.10.11.06; Mon, 05 Jun 2023 10:11:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235105AbjFERB7 (ORCPT + 99 others); Mon, 5 Jun 2023 13:01:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235088AbjFERBt (ORCPT ); Mon, 5 Jun 2023 13:01:49 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ECB0F183 for ; Mon, 5 Jun 2023 10:01:42 -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 3B02B152B; Mon, 5 Jun 2023 10:02:28 -0700 (PDT) Received: from e121345-lin.cambridge.arm.com (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AD32B3F587; Mon, 5 Jun 2023 10:01:41 -0700 (PDT) From: Robin Murphy To: will@kernel.org Cc: mark.rutland@arm.com, suzuki.poulose@arm.com, bwicaksono@nvidia.com, ilkka@os.amperecomputing.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/4] perf/arm_cspmu: Fix event attribute type Date: Mon, 5 Jun 2023 18:01:31 +0100 Message-Id: <27c0804af64007b2400abbc40278f642ee6a0a29.1685983270.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.39.2.101.g768bb238c484.dirty In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 ARM_CSPMU_EVENT_ATTR() defines a struct perf_pmu_events_attr, so arm_cspmu_sysfs_event_show() should not be interpreting it as struct dev_ext_attribute. Fixes: e37dfd65731d ("perf: arm_cspmu: Add support for ARM CoreSight PMU driver") Reviewed-by: Suzuki K Poulose Reviewed-and-tested-by: Ilkka Koskinen Signed-off-by: Robin Murphy --- Decided to stick with this rather than change the definition, because I like avoiding casts :) drivers/perf/arm_cspmu/arm_cspmu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/perf/arm_cspmu/arm_cspmu.c b/drivers/perf/arm_cspmu/arm_cspmu.c index a3f1c410b417..72dc7a9e1ca8 100644 --- a/drivers/perf/arm_cspmu/arm_cspmu.c +++ b/drivers/perf/arm_cspmu/arm_cspmu.c @@ -189,10 +189,10 @@ static inline bool use_64b_counter_reg(const struct arm_cspmu *cspmu) ssize_t arm_cspmu_sysfs_event_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct dev_ext_attribute *eattr = - container_of(attr, struct dev_ext_attribute, attr); - return sysfs_emit(buf, "event=0x%llx\n", - (unsigned long long)eattr->var); + struct perf_pmu_events_attr *pmu_attr; + + pmu_attr = container_of(attr, typeof(*pmu_attr), attr); + return sysfs_emit(buf, "event=0x%llx\n", pmu_attr->id); } EXPORT_SYMBOL_GPL(arm_cspmu_sysfs_event_show); -- 2.39.2.101.g768bb238c484.dirty