summaryrefslogtreecommitdiffstats
path: root/drivers/perf
diff options
context:
space:
mode:
authorQi Liu <liuqi115@huawei.com>2021-06-09 14:41:02 +0800
committerWill Deacon <will@kernel.org>2021-06-11 11:18:40 +0100
commit773510f4d2775bda7cec585e8643f4269c4944e5 (patch)
tree7aec75cefd19e78f17c24239037fbae1b57af92f /drivers/perf
parentb323dfe02e56627e4eaed7cf59dc609da67a1651 (diff)
downloadlinux-773510f4d2775bda7cec585e8643f4269c4944e5.tar.gz
linux-773510f4d2775bda7cec585e8643f4269c4944e5.tar.bz2
linux-773510f4d2775bda7cec585e8643f4269c4944e5.zip
drivers/perf: Simplify EVENT ATTR macro in fsl_imx8_ddr_perf.c
Use common macro PMU_EVENT_ATTR_ID to simplify IMX8_DDR_PMU_EVENT_ATTR Reviewed by Frank Li <Frank .li@nxp.com> Cc: Frank Li <Frank.li@nxp.com> Cc: Will Deacon <will@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Qi Liu <liuqi115@huawei.com> Link: https://lore.kernel.org/r/1623220863-58233-7-git-send-email-liuqi115@huawei.com Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'drivers/perf')
-rw-r--r--drivers/perf/fsl_imx8_ddr_perf.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_perf.c
index df048fe42fc2..2a1d78794a4e 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),