drivers/perf: Simplify EVENT ATTR macro in SMMU PMU driver
authorQi Liu <liuqi115@huawei.com>
Wed, 9 Jun 2021 06:40:58 +0000 (14:40 +0800)
committerWill Deacon <will@kernel.org>
Fri, 11 Jun 2021 10:18:40 +0000 (11:18 +0100)
Use common macro PMU_EVENT_ATTR_ID to simplify SMMU_EVENT_ATTR

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-3-git-send-email-liuqi115@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm_smmuv3_pmu.c

index c195a9a..2263488 100644 (file)
@@ -511,11 +511,8 @@ static ssize_t smmu_pmu_event_show(struct device *dev,
        return sysfs_emit(page, "event=0x%02llx\n", pmu_attr->id);
 }
 
-#define SMMU_EVENT_ATTR(name, config)                                  \
-       (&((struct perf_pmu_events_attr) {                              \
-               .attr = __ATTR(name, 0444, smmu_pmu_event_show, NULL),  \
-               .id = config,                                           \
-       }).attr.attr)
+#define SMMU_EVENT_ATTR(name, config)                  \
+       PMU_EVENT_ATTR_ID(name, smmu_pmu_event_show, config)
 
 static struct attribute *smmu_pmu_events[] = {
        SMMU_EVENT_ATTR(cycles, 0),