Skip to content

Commit 78b1d3c

Browse files
77liuqiwilldeacon
authored andcommitted
drivers/perf: Simplify EVENT ATTR macro in qcom_l3_pmu.c
Use common macro PMU_EVENT_ATTR_ID to simplify L3CACHE_EVENT_ATTR Cc: Andy Gross <agross@kernel.org> 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-5-git-send-email-liuqi115@huawei.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent 0bf2d72 commit 78b1d3c

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/perf/qcom_l3_pmu.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -647,10 +647,7 @@ static ssize_t l3cache_pmu_event_show(struct device *dev,
647647
}
648648

649649
#define L3CACHE_EVENT_ATTR(_name, _id) \
650-
(&((struct perf_pmu_events_attr[]) { \
651-
{ .attr = __ATTR(_name, 0444, l3cache_pmu_event_show, NULL), \
652-
.id = _id, } \
653-
})[0].attr.attr)
650+
PMU_EVENT_ATTR_ID(_name, l3cache_pmu_event_show, _id)
654651

655652
static struct attribute *qcom_l3_cache_pmu_events[] = {
656653
L3CACHE_EVENT_ATTR(cycles, L3_EVENT_CYCLES),

0 commit comments

Comments
 (0)