diff options
author | Mark Rutland <Mark.Rutland@arm.com> | 2013-01-18 16:10:06 +0000 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2013-01-18 16:54:30 +0000 |
commit | 9dcbf466559f6f2f55d60eb5a1bbebc8e694b52a (patch) | |
tree | 885c469162ee1e518ca8715cef9dd58536991bf3 /arch/arm | |
parent | 8f3b90b585d3e879b03ce2a202da04d59dd5b699 (diff) | |
download | talos-obmc-linux-9dcbf466559f6f2f55d60eb5a1bbebc8e694b52a.tar.gz talos-obmc-linux-9dcbf466559f6f2f55d60eb5a1bbebc8e694b52a.zip |
ARM: perf: simplify __hw_perf_event_init err handling
Currently __hw_perf_event_init has an err variable that's ignored right
until the end, where it's initialised, conditionally set, and then used
as a boolean flag deciding whether to return another error code.
This patch removes the err variable and simplifies the associated error
handling logic.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/kernel/perf_event.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index 6df1969811c8..31e0eb353cd8 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c @@ -350,7 +350,7 @@ __hw_perf_event_init(struct perf_event *event) { struct arm_pmu *armpmu = to_arm_pmu(event->pmu); struct hw_perf_event *hwc = &event->hw; - int mapping, err; + int mapping; mapping = armpmu->map_event(event); @@ -399,14 +399,12 @@ __hw_perf_event_init(struct perf_event *event) local64_set(&hwc->period_left, hwc->sample_period); } - err = 0; if (event->group_leader != event) { - err = validate_group(event); - if (err) + if (validate_group(event) != 0); return -EINVAL; } - return err; + return 0; } static int armpmu_event_init(struct perf_event *event) |