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>
This commit is contained in:
parent
8f3b90b585
commit
9dcbf46655
|
@ -350,7 +350,7 @@ __hw_perf_event_init(struct perf_event *event)
|
||||||
{
|
{
|
||||||
struct arm_pmu *armpmu = to_arm_pmu(event->pmu);
|
struct arm_pmu *armpmu = to_arm_pmu(event->pmu);
|
||||||
struct hw_perf_event *hwc = &event->hw;
|
struct hw_perf_event *hwc = &event->hw;
|
||||||
int mapping, err;
|
int mapping;
|
||||||
|
|
||||||
mapping = armpmu->map_event(event);
|
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);
|
local64_set(&hwc->period_left, hwc->sample_period);
|
||||||
}
|
}
|
||||||
|
|
||||||
err = 0;
|
|
||||||
if (event->group_leader != event) {
|
if (event->group_leader != event) {
|
||||||
err = validate_group(event);
|
if (validate_group(event) != 0);
|
||||||
if (err)
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int armpmu_event_init(struct perf_event *event)
|
static int armpmu_event_init(struct perf_event *event)
|
||||||
|
|
Loading…
Reference in New Issue