Commit f2e9d46a authored by Thomas Richter's avatar Thomas Richter Committed by Heiko Carstens
Browse files

s390/cpum_sf: Use sf_buffer_available()



Use sf_buffer_available() consistently throughtout the code
to test for the existence of sampling buffer.
No functional change.

Signed-off-by: default avatarThomas Richter <tmricht@linux.ibm.com>
Reviewed-by: default avatarHendrik Brueckner <brueckner@linux.ibm.com>
Reviewed-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent de6d22cc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -404,7 +404,7 @@ static void sfb_init_allocs(unsigned long num, struct hw_perf_event *hwc)

static void deallocate_buffers(struct cpu_hw_sf *cpuhw)
{
	if (cpuhw->sfb.sdbt)
	if (sf_buffer_available(cpuhw))
		free_sampling_buffer(&cpuhw->sfb);
}

@@ -1793,7 +1793,7 @@ static int cpumsf_pmu_add(struct perf_event *event, int flags)
	if (cpuhw->flags & PMU_F_IN_USE)
		return -EAGAIN;

	if (!SAMPL_DIAG_MODE(&event->hw) && !cpuhw->sfb.sdbt)
	if (!SAMPL_DIAG_MODE(&event->hw) && !sf_buffer_available(cpuhw))
		return -EINVAL;

	perf_pmu_disable(event->pmu);