diff options
author | Qi Liu <[email protected]> | 2021-06-09 14:40:59 +0800 |
---|---|---|
committer | Will Deacon <[email protected]> | 2021-06-11 11:18:40 +0100 |
commit | 0bf2d7298842afbc28a5413024ebc444a599e980 (patch) | |
tree | 18e78c26a3e517645cc2ee39a00a743bdc7d8815 | |
parent | 7ac87a8dfbd9c42fa1920773b09a57586222aad4 (diff) |
drivers/perf: Simplify EVENT ATTR macro in qcom_l2_pmu.c
Use common macro PMU_EVENT_ATTR_ID to simplify L2CACHE_EVENT_ATTR
Cc: Andy Gross <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Mark Rutland <[email protected]>
Signed-off-by: Qi Liu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[email protected]>
-rw-r--r-- | drivers/perf/qcom_l2_pmu.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/perf/qcom_l2_pmu.c b/drivers/perf/qcom_l2_pmu.c index b60e30141583..5b093badd0f6 100644 --- a/drivers/perf/qcom_l2_pmu.c +++ b/drivers/perf/qcom_l2_pmu.c @@ -679,11 +679,8 @@ static ssize_t l2cache_pmu_event_show(struct device *dev, return sysfs_emit(page, "event=0x%02llx\n", pmu_attr->id); } -#define L2CACHE_EVENT_ATTR(_name, _id) \ - (&((struct perf_pmu_events_attr[]) { \ - { .attr = __ATTR(_name, 0444, l2cache_pmu_event_show, NULL), \ - .id = _id, } \ - })[0].attr.attr) +#define L2CACHE_EVENT_ATTR(_name, _id) \ + PMU_EVENT_ATTR_ID(_name, l2cache_pmu_event_show, _id) static struct attribute *l2_cache_pmu_events[] = { L2CACHE_EVENT_ATTR(cycles, L2_EVENT_CYCLES), |