diff options
author | Mark Rutland <Mark.Rutland@arm.com> | 2013-01-18 11:10:06 -0500 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2013-01-18 11:54:30 -0500 |
commit | 9dcbf466559f6f2f55d60eb5a1bbebc8e694b52a (patch) | |
tree | 885c469162ee1e518ca8715cef9dd58536991bf3 /arch/arm | |
parent | 8f3b90b585d3e879b03ce2a202da04d59dd5b699 (diff) |
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) | |||
350 | { | 350 | { |
351 | struct arm_pmu *armpmu = to_arm_pmu(event->pmu); | 351 | struct arm_pmu *armpmu = to_arm_pmu(event->pmu); |
352 | struct hw_perf_event *hwc = &event->hw; | 352 | struct hw_perf_event *hwc = &event->hw; |
353 | int mapping, err; | 353 | int mapping; |
354 | 354 | ||
355 | mapping = armpmu->map_event(event); | 355 | mapping = armpmu->map_event(event); |
356 | 356 | ||
@@ -399,14 +399,12 @@ __hw_perf_event_init(struct perf_event *event) | |||
399 | local64_set(&hwc->period_left, hwc->sample_period); | 399 | local64_set(&hwc->period_left, hwc->sample_period); |
400 | } | 400 | } |
401 | 401 | ||
402 | err = 0; | ||
403 | if (event->group_leader != event) { | 402 | if (event->group_leader != event) { |
404 | err = validate_group(event); | 403 | if (validate_group(event) != 0); |
405 | if (err) | ||
406 | return -EINVAL; | 404 | return -EINVAL; |
407 | } | 405 | } |
408 | 406 | ||
409 | return err; | 407 | return 0; |
410 | } | 408 | } |
411 | 409 | ||
412 | static int armpmu_event_init(struct perf_event *event) | 410 | static int armpmu_event_init(struct perf_event *event) |