Skip to content

Commit 7ac87a8

Browse files
77liuqiwilldeacon
authored andcommitted
drivers/perf: Simplify EVENT ATTR macro in SMMU PMU driver
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>
1 parent f8e6d24 commit 7ac87a8

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

drivers/perf/arm_smmuv3_pmu.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,8 @@ static ssize_t smmu_pmu_event_show(struct device *dev,
511511
return sysfs_emit(page, "event=0x%02llx\n", pmu_attr->id);
512512
}
513513

514-
#define SMMU_EVENT_ATTR(name, config) \
515-
(&((struct perf_pmu_events_attr) { \
516-
.attr = __ATTR(name, 0444, smmu_pmu_event_show, NULL), \
517-
.id = config, \
518-
}).attr.attr)
514+
#define SMMU_EVENT_ATTR(name, config) \
515+
PMU_EVENT_ATTR_ID(name, smmu_pmu_event_show, config)
519516

520517
static struct attribute *smmu_pmu_events[] = {
521518
SMMU_EVENT_ATTR(cycles, 0),

0 commit comments

Comments
 (0)