summaryrefslogtreecommitdiff
path: root/arch/s390/kernel
diff options
context:
space:
mode:
authorThomas Richter <tmricht@linux.ibm.com>2023-04-06 12:40:42 +0300
committerVasily Gorbik <gor@linux.ibm.com>2023-04-19 17:48:14 +0300
commit1a33aee1dc2476c5937a0890f2dfc228a165f364 (patch)
treeb3ad8791b521e4be9317ff6ea48407454ade77c8 /arch/s390/kernel
parent9ae9b868aeaad377f6315d7196a43e8827e24cb3 (diff)
downloadlinux-1a33aee1dc2476c5937a0890f2dfc228a165f364.tar.xz
s390/cpum_cf: remove function validate_ctr_auth() by inline code
Remove function validate_ctr_auth() and replace this very small function by its body. No functional change. Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Acked-by: Heiko Carstens <hca@linux.ibm.com> Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r--arch/s390/kernel/perf_cpum_cf.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c
index ecbb89b76906..cf1b6e8a708d 100644
--- a/arch/s390/kernel/perf_cpum_cf.c
+++ b/arch/s390/kernel/perf_cpum_cf.c
@@ -444,21 +444,6 @@ static int validate_ctr_version(const u64 config, enum cpumf_ctr_set set)
return err;
}
-static int validate_ctr_auth(const struct hw_perf_event *hwc)
-{
- int err = -ENOENT;
-
- /* Check authorization for cpu counter sets.
- * If the particular CPU counter set is not authorized,
- * return with -ENOENT in order to fall back to other
- * PMUs that might suffice the event request.
- */
- if ((hwc->config_base & cpumf_ctr_info.auth_ctl))
- err = 0;
-
- return err;
-}
-
/*
* Change the CPUMF state to active.
* Enable and activate the CPU-counter sets according
@@ -596,7 +581,6 @@ static int __hw_perf_event_init(struct perf_event *event, unsigned int type)
struct perf_event_attr *attr = &event->attr;
struct hw_perf_event *hwc = &event->hw;
enum cpumf_ctr_set set;
- int err = 0;
u64 ev;
switch (type) {
@@ -672,12 +656,15 @@ static int __hw_perf_event_init(struct perf_event *event, unsigned int type)
cpumf_hw_inuse();
event->destroy = hw_perf_event_destroy;
- /* Finally, validate version and authorization of the counter set */
- err = validate_ctr_auth(hwc);
- if (!err)
- err = validate_ctr_version(hwc->config, set);
-
- return err;
+ /*
+ * Finally, validate version and authorization of the counter set.
+ * If the particular CPU counter set is not authorized,
+ * return with -ENOENT in order to fall back to other
+ * PMUs that might suffice the event request.
+ */
+ if (!(hwc->config_base & cpumf_ctr_info.auth_ctl))
+ return -ENOENT;
+ return validate_ctr_version(hwc->config, set);
}
/* Events CPU_CYLCES and INSTRUCTIONS can be submitted with two different