Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3764951pxj; Mon, 7 Jun 2021 20:38:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIt/WVfu1eCNazHCBIIfe5ZjetvxLuaW5sI/SenrAJhkA2+bNMQ4YeTJY2if+0zVedlFnJ X-Received: by 2002:a50:fb8f:: with SMTP id e15mr22443084edq.46.1623123487072; Mon, 07 Jun 2021 20:38:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623123487; cv=none; d=google.com; s=arc-20160816; b=Ru63Fd6yi9nDbm2J+wy9+8vsgrk6tOnCncQ862ulxVdzkXcD6Gsa2bGmQ5SwCrBQd/ XPMdhVC3moJt8NjqFPiGsqYCtBu2+eIp9O2b11DfkmPGzD3bFd6sRsVWjO33LJZHdnzD r7jWDMPiQR7xTlokFZAyfmmBpMTGiDc8HPMOlJt6JpSSrHgisVM6MucQsBWPjeYlR5sp DOZkhzI9BJJUYrKdYdzUeT5ugAIX3aL7HC95wh/sRvsyodG+jwN9gfARXgF9lVrnhV6u Wzms+8IgsMdkDA36Mia3Tsh0YhPl0AOmbyvUPU9p9isxg7IeeoDzwc9kIZomcxifajtB 1PCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=lIzzHSEVcX8IZEMtsGOGwYxEIcIaP+C2YSy2WbebFPs=; b=cojPNIvAKYdk/XyeGHxJHF+KBnTN/YD3dn01JN/FVEtgAkDVV55VBoxx2bHtOiS9Ei NS1kPWHfpKWuUZe0mktKA/LCbvYZ7Iz3LQM6PBcWaQFaHCl7WoV/k4SUqXuaqtL7Occi XKpWKAIyYJVPxtmgO9Ql1JZydttVP3rEBGaK0UbGCZ2xAk29XbypiFIKU252bGGL2zpV 0h2pqDZM95rcMW/GwjJgRFKPj49fk3SO6ErOU5GSjQuOqpdDaMSl61RoPJfaF3w3yGd5 Wl3HdXHOUzy0/mRySyTJZvyzHjFFY73i4LtF5nW4ZPgeGJdta39BAUVXe3eiLdYHJK1i q9vg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si15940447edx.155.2021.06.07.20.37.43; Mon, 07 Jun 2021 20:38:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231380AbhFHDhB (ORCPT + 99 others); Mon, 7 Jun 2021 23:37:01 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:5279 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbhFHDg6 (ORCPT ); Mon, 7 Jun 2021 23:36:58 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4FzbN65cNGz1BKp2; Tue, 8 Jun 2021 11:30:14 +0800 (CST) Received: from dggema757-chm.china.huawei.com (10.1.198.199) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Tue, 8 Jun 2021 11:33:42 +0800 Received: from localhost.localdomain (10.69.192.56) by dggema757-chm.china.huawei.com (10.1.198.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Tue, 8 Jun 2021 11:33:42 +0800 From: Qi Liu To: , CC: , Frank Li , Will Deacon , Mark Rutland Subject: [PATCH v3 7/9] drivers/perf: Simplify EVENT ATTR macro in fsl_imx8_ddr_perf.c Date: Tue, 8 Jun 2021 11:33:19 +0800 Message-ID: <1623123201-45634-8-git-send-email-liuqi115@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1623123201-45634-1-git-send-email-liuqi115@huawei.com> References: <1623123201-45634-1-git-send-email-liuqi115@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggema757-chm.china.huawei.com (10.1.198.199) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use common macro PMU_EVENT_ATTR_ID to simplify IMX8_DDR_PMU_EVENT_ATTR. Cc: Frank Li Cc: Will Deacon Cc: Mark Rutland Reviewed by Frank Li Signed-off-by: Qi Liu --- drivers/perf/fsl_imx8_ddr_perf.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_perf.c index 2bbb931..0406215 100644 --- a/drivers/perf/fsl_imx8_ddr_perf.c +++ b/drivers/perf/fsl_imx8_ddr_perf.c @@ -222,11 +222,8 @@ ddr_pmu_event_show(struct device *dev, struct device_attribute *attr, return sysfs_emit(page, "event=0x%02llx\n", pmu_attr->id); } -#define IMX8_DDR_PMU_EVENT_ATTR(_name, _id) \ - (&((struct perf_pmu_events_attr[]) { \ - { .attr = __ATTR(_name, 0444, ddr_pmu_event_show, NULL),\ - .id = _id, } \ - })[0].attr.attr) +#define IMX8_DDR_PMU_EVENT_ATTR(_name, _id) \ + PMU_EVENT_ATTR_ID(_name, ddr_pmu_event_show, _id) static struct attribute *ddr_perf_events_attrs[] = { IMX8_DDR_PMU_EVENT_ATTR(cycles, EVENT_CYCLES_ID), -- 2.7.4