Skip to content

Commit 9ae9b86

Browse files
Thomas RichterVasily Gorbik
authored andcommitted
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>
1 parent 46c4d94 commit 9ae9b86

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

arch/s390/kernel/perf_cpum_cf.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,7 @@ static enum cpumf_ctr_set get_counter_set(u64 event)
389389
return set;
390390
}
391391

392-
static int validate_ctr_version(const struct hw_perf_event *hwc,
393-
enum cpumf_ctr_set set)
392+
static int validate_ctr_version(const u64 config, enum cpumf_ctr_set set)
394393
{
395394
u16 mtdiag_ctl;
396395
int err = 0;
@@ -404,18 +403,17 @@ static int validate_ctr_version(const struct hw_perf_event *hwc,
404403
break;
405404
case CPUMF_CTR_SET_CRYPTO:
406405
if ((cpumf_ctr_info.csvn >= 1 && cpumf_ctr_info.csvn <= 5 &&
407-
hwc->config > 79) ||
408-
(cpumf_ctr_info.csvn >= 6 && hwc->config > 83))
406+
config > 79) || (cpumf_ctr_info.csvn >= 6 && config > 83))
409407
err = -EOPNOTSUPP;
410408
break;
411409
case CPUMF_CTR_SET_EXT:
412410
if (cpumf_ctr_info.csvn < 1)
413411
err = -EOPNOTSUPP;
414-
if ((cpumf_ctr_info.csvn == 1 && hwc->config > 159) ||
415-
(cpumf_ctr_info.csvn == 2 && hwc->config > 175) ||
416-
(cpumf_ctr_info.csvn >= 3 && cpumf_ctr_info.csvn <= 5
417-
&& hwc->config > 255) ||
418-
(cpumf_ctr_info.csvn >= 6 && hwc->config > 287))
412+
if ((cpumf_ctr_info.csvn == 1 && config > 159) ||
413+
(cpumf_ctr_info.csvn == 2 && config > 175) ||
414+
(cpumf_ctr_info.csvn >= 3 && cpumf_ctr_info.csvn <= 5 &&
415+
config > 255) ||
416+
(cpumf_ctr_info.csvn >= 6 && config > 287))
419417
err = -EOPNOTSUPP;
420418
break;
421419
case CPUMF_CTR_SET_MT_DIAG:
@@ -677,7 +675,7 @@ static int __hw_perf_event_init(struct perf_event *event, unsigned int type)
677675
/* Finally, validate version and authorization of the counter set */
678676
err = validate_ctr_auth(hwc);
679677
if (!err)
680-
err = validate_ctr_version(hwc, set);
678+
err = validate_ctr_version(hwc->config, set);
681679

682680
return err;
683681
}

0 commit comments

Comments
 (0)