summaryrefslogtreecommitdiff
path: root/include/linux/perf
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2017-04-11 09:39:45 +0100
committerWill Deacon <will.deacon@arm.com>2017-04-11 16:29:53 +0100
commit083c52144a19c69b7956aa53c913ba621f7c5ae2 (patch)
tree4ac19de3eb832f5758f2999f351430d3ebcee6a5 /include/linux/perf
parenta9e469d1c89b5e9890859b5f001601498549577d (diff)
downloadlwn-083c52144a19c69b7956aa53c913ba621f7c5ae2.tar.gz
lwn-083c52144a19c69b7956aa53c913ba621f7c5ae2.zip
drivers/perf: arm_pmu: define armpmu_init_fn
We expect an ARM PMU's init function to have a particular prototype, which we open-code in a few places. This is less than ideal, considering that we cast a void value to this type in one location, and a mismatch could easily be missed. Add a typedef so that we can ensure this is consistent. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Tested-by: Jeremy Linton <jeremy.linton@arm.com> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'include/linux/perf')
-rw-r--r--include/linux/perf/arm_pmu.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/perf/arm_pmu.h b/include/linux/perf/arm_pmu.h
index 44f43fcf2524..4249914315a4 100644
--- a/include/linux/perf/arm_pmu.h
+++ b/include/linux/perf/arm_pmu.h
@@ -132,10 +132,12 @@ int armpmu_map_event(struct perf_event *event,
[PERF_COUNT_HW_CACHE_RESULT_MAX],
u32 raw_event_mask);
+typedef int (*armpmu_init_fn)(struct arm_pmu *);
+
struct pmu_probe_info {
unsigned int cpuid;
unsigned int mask;
- int (*init)(struct arm_pmu *);
+ armpmu_init_fn init;
};
#define PMU_PROBE(_cpuid, _mask, _fn) \