perf, x86: Clean up reserve_ds_buffers() signature
Now that reserve_ds_buffers() never fails, change it to return void and remove all code dealing with the error return. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Stephane Eranian <eranian@google.com> LKML-Reference: <20101019134808.462621937@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
6809b6ea73
commit
f80c9e304b
2 changed files with 6 additions and 12 deletions
|
@ -382,7 +382,7 @@ static void release_pmc_hardware(void) {}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int reserve_ds_buffers(void);
|
static void reserve_ds_buffers(void);
|
||||||
static void release_ds_buffers(void);
|
static void release_ds_buffers(void);
|
||||||
|
|
||||||
static void hw_perf_event_destroy(struct perf_event *event)
|
static void hw_perf_event_destroy(struct perf_event *event)
|
||||||
|
@ -546,11 +546,8 @@ static int __x86_pmu_event_init(struct perf_event *event)
|
||||||
if (atomic_read(&active_events) == 0) {
|
if (atomic_read(&active_events) == 0) {
|
||||||
if (!reserve_pmc_hardware())
|
if (!reserve_pmc_hardware())
|
||||||
err = -EBUSY;
|
err = -EBUSY;
|
||||||
else {
|
else
|
||||||
err = reserve_ds_buffers();
|
reserve_ds_buffers();
|
||||||
if (err)
|
|
||||||
release_pmc_hardware();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!err)
|
if (!err)
|
||||||
atomic_inc(&active_events);
|
atomic_inc(&active_events);
|
||||||
|
|
|
@ -191,7 +191,7 @@ static void release_ds_buffers(void)
|
||||||
put_online_cpus();
|
put_online_cpus();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int reserve_ds_buffers(void)
|
static void reserve_ds_buffers(void)
|
||||||
{
|
{
|
||||||
int bts_err = 0, pebs_err = 0;
|
int bts_err = 0, pebs_err = 0;
|
||||||
int cpu;
|
int cpu;
|
||||||
|
@ -200,7 +200,7 @@ static int reserve_ds_buffers(void)
|
||||||
x86_pmu.pebs_active = 0;
|
x86_pmu.pebs_active = 0;
|
||||||
|
|
||||||
if (!x86_pmu.bts && !x86_pmu.pebs)
|
if (!x86_pmu.bts && !x86_pmu.pebs)
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
if (!x86_pmu.bts)
|
if (!x86_pmu.bts)
|
||||||
bts_err = 1;
|
bts_err = 1;
|
||||||
|
@ -251,8 +251,6 @@ static int reserve_ds_buffers(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
put_online_cpus();
|
put_online_cpus();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -714,9 +712,8 @@ static void intel_ds_init(void)
|
||||||
|
|
||||||
#else /* CONFIG_CPU_SUP_INTEL */
|
#else /* CONFIG_CPU_SUP_INTEL */
|
||||||
|
|
||||||
static int reserve_ds_buffers(void)
|
static void reserve_ds_buffers(void)
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void release_ds_buffers(void)
|
static void release_ds_buffers(void)
|
||||||
|
|
Loading…
Reference in a new issue