@@ -293,13 +293,7 @@ static int mmdc_pmu_event_init(struct perf_event *event)
return -EOPNOTSUPP;
}
- if (event->attr.exclude_user ||
- event->attr.exclude_kernel ||
- event->attr.exclude_hv ||
- event->attr.exclude_idle ||
- event->attr.exclude_host ||
- event->attr.exclude_guest ||
- event->attr.sample_period)
+ if (event_has_exclude_flags(event) || event->attr.sample_period)
return -EINVAL;
if (cfg < 0 || cfg >= MMDC_NUM_COUNTERS)
@@ -314,12 +314,7 @@ static int l2x0_pmu_event_init(struct perf_event *event)
event->attach_state & PERF_ATTACH_TASK)
return -EINVAL;
- if (event->attr.exclude_user ||
- event->attr.exclude_kernel ||
- event->attr.exclude_hv ||
- event->attr.exclude_idle ||
- event->attr.exclude_host ||
- event->attr.exclude_guest)
+ if (event_has_exclude_flags(event))
return -EINVAL;
if (event->cpu < 0)
Replace checking of perf event exclusion flags with perf macro. Signed-off-by: Andrew Murray <andrew.murray@arm.com> --- arch/arm/mach-imx/mmdc.c | 8 +------- arch/arm/mm/cache-l2x0-pmu.c | 7 +------ 2 files changed, 2 insertions(+), 13 deletions(-)