diff options
author | Thomas Richter <tmricht@linux.ibm.com> | 2023-04-06 11:32:18 +0200 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2023-04-19 16:48:14 +0200 |
commit | 9ae9b868aeaad377f6315d7196a43e8827e24cb3 (patch) | |
tree | fea1f83e682ef156f9e0561f5c5d736852c6b1b8 /arch/s390 | |
parent | 46c4d945ea1f9beebf49148b0d4aafb44e41ceb6 (diff) |
s390/cpum_cf: provide counter number to validate_ctr_version()
Function validate_ctr_version() first parameter is a pointer to
a large structure, but only member hw_perf_event::config is used.
Supply this structure member value in the function invocation.
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')
-rw-r--r-- | arch/s390/kernel/perf_cpum_cf.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c index e235b5b83d3c..ecbb89b76906 100644 --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c @@ -389,8 +389,7 @@ static enum cpumf_ctr_set get_counter_set(u64 event) return set; } -static int validate_ctr_version(const struct hw_perf_event *hwc, - enum cpumf_ctr_set set) +static int validate_ctr_version(const u64 config, enum cpumf_ctr_set set) { u16 mtdiag_ctl; int err = 0; @@ -404,18 +403,17 @@ static int validate_ctr_version(const struct hw_perf_event *hwc, break; case CPUMF_CTR_SET_CRYPTO: if ((cpumf_ctr_info.csvn >= 1 && cpumf_ctr_info.csvn <= 5 && - hwc->config > 79) || - (cpumf_ctr_info.csvn >= 6 && hwc->config > 83)) + config > 79) || (cpumf_ctr_info.csvn >= 6 && config > 83)) err = -EOPNOTSUPP; break; case CPUMF_CTR_SET_EXT: if (cpumf_ctr_info.csvn < 1) err = -EOPNOTSUPP; - if ((cpumf_ctr_info.csvn == 1 && hwc->config > 159) || - (cpumf_ctr_info.csvn == 2 && hwc->config > 175) || - (cpumf_ctr_info.csvn >= 3 && cpumf_ctr_info.csvn <= 5 - && hwc->config > 255) || - (cpumf_ctr_info.csvn >= 6 && hwc->config > 287)) + if ((cpumf_ctr_info.csvn == 1 && config > 159) || + (cpumf_ctr_info.csvn == 2 && config > 175) || + (cpumf_ctr_info.csvn >= 3 && cpumf_ctr_info.csvn <= 5 && + config > 255) || + (cpumf_ctr_info.csvn >= 6 && config > 287)) err = -EOPNOTSUPP; break; case CPUMF_CTR_SET_MT_DIAG: @@ -677,7 +675,7 @@ static int __hw_perf_event_init(struct perf_event *event, unsigned int type) /* Finally, validate version and authorization of the counter set */ err = validate_ctr_auth(hwc); if (!err) - err = validate_ctr_version(hwc, set); + err = validate_ctr_version(hwc->config, set); return err; } |