Skip to content

Commit 58354c7

Browse files
Thomas RichterVasily Gorbik
authored andcommitted
s390/pai: rename structure member users to active_events
Rename structure member users to active_events to make it consistent with PMU pai_ext. Also use the same prefix syntax for increment and decrement operators in both PMUs. Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent d3db4ac commit 58354c7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

arch/s390/kernel/perf_pai_crypto.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct pai_userdata {
3535
struct paicrypt_map {
3636
unsigned long *page; /* Page for CPU to store counters */
3737
struct pai_userdata *save; /* Page to store no-zero counters */
38-
unsigned int users; /* # of PAI crypto users */
38+
unsigned int active_events; /* # of PAI crypto users */
3939
unsigned int refcnt; /* Reference count mapped buffers */
4040
enum paievt_mode mode; /* Type of event */
4141
struct perf_event *event; /* Perf event for sampling */
@@ -58,8 +58,8 @@ static void paicrypt_event_destroy(struct perf_event *event)
5858
mutex_lock(&pai_reserve_mutex);
5959
debug_sprintf_event(cfm_dbg, 5, "%s event %#llx cpu %d users %d"
6060
" mode %d refcnt %d\n", __func__,
61-
event->attr.config, event->cpu, cpump->users,
62-
cpump->mode, cpump->refcnt);
61+
event->attr.config, event->cpu,
62+
cpump->active_events, cpump->mode, cpump->refcnt);
6363
if (!--cpump->refcnt) {
6464
debug_sprintf_event(cfm_dbg, 4, "%s page %#lx save %p\n",
6565
__func__, (unsigned long)cpump->page,
@@ -174,7 +174,7 @@ static int paicrypt_busy(struct perf_event_attr *a, struct paicrypt_map *cpump)
174174
}
175175
debug_sprintf_event(cfm_dbg, 5, "%s sample_period %#llx users %d"
176176
" mode %d refcnt %d page %#lx save %p rc %d\n",
177-
__func__, a->sample_period, cpump->users,
177+
__func__, a->sample_period, cpump->active_events,
178178
cpump->mode, cpump->refcnt,
179179
(unsigned long)cpump->page, cpump->save, rc);
180180
mutex_unlock(&pai_reserve_mutex);
@@ -260,7 +260,7 @@ static int paicrypt_add(struct perf_event *event, int flags)
260260
struct paicrypt_map *cpump = this_cpu_ptr(&paicrypt_map);
261261
unsigned long ccd;
262262

263-
if (cpump->users++ == 0) {
263+
if (++cpump->active_events == 1) {
264264
ccd = virt_to_phys(cpump->page) | PAI_CRYPTO_KERNEL_OFFSET;
265265
WRITE_ONCE(S390_lowcore.ccd, ccd);
266266
__ctl_set_bit(0, 50);
@@ -291,7 +291,7 @@ static void paicrypt_del(struct perf_event *event, int flags)
291291
if (!event->attr.sample_period)
292292
/* Only counting needs to read counter */
293293
paicrypt_stop(event, PERF_EF_UPDATE);
294-
if (cpump->users-- == 1) {
294+
if (--cpump->active_events == 0) {
295295
__ctl_clear_bit(0, 50);
296296
WRITE_ONCE(S390_lowcore.ccd, 0);
297297
}

0 commit comments

Comments
 (0)