]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/cpum_sf: Use sf_buffer_available()
authorThomas Richter <tmricht@linux.ibm.com>
Thu, 24 Oct 2024 11:33:55 +0000 (13:33 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 29 Oct 2024 10:17:18 +0000 (11:17 +0100)
Use sf_buffer_available() consistently throughtout the code
to test for the existence of sampling buffer.
No functional change.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Reviewed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/kernel/perf_cpum_sf.c

index 7a88de52025ca0429c6ab3a911c16ccd13f2b785..8a690f4f04d92f53786e977388784ce01a93632c 100644 (file)
@@ -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);