Commit 9ae9b868 authored by Thomas Richter's avatar Thomas Richter Committed by Vasily Gorbik

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: default avatarThomas Richter <tmricht@linux.ibm.com>
Acked-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Acked-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 46c4d945
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment