s390/pai: rename structure member users to active_events
authorThomas Richter <tmricht@linux.ibm.com>
Thu, 20 Oct 2022 09:55:52 +0000 (11:55 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 26 Oct 2022 12:46:52 +0000 (14:46 +0200)
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>
arch/s390/kernel/perf_pai_crypto.c

index 92184611af6861fa11585664149cb683a402e1bf..529a2fee4ea511c719ad43e565aa40b854cc0049 100644 (file)
@@ -35,7 +35,7 @@ struct pai_userdata {
 struct paicrypt_map {
        unsigned long *page;            /* Page for CPU to store counters */
        struct pai_userdata *save;      /* Page to store no-zero counters */
-       unsigned int users;             /* # of PAI crypto users */
+       unsigned int active_events;     /* # of PAI crypto users */
        unsigned int refcnt;            /* Reference count mapped buffers */
        enum paievt_mode mode;          /* Type of event */
        struct perf_event *event;       /* Perf event for sampling */
@@ -58,8 +58,8 @@ static void paicrypt_event_destroy(struct perf_event *event)
        mutex_lock(&pai_reserve_mutex);
        debug_sprintf_event(cfm_dbg, 5, "%s event %#llx cpu %d users %d"
                            " mode %d refcnt %d\n", __func__,
-                           event->attr.config, event->cpu, cpump->users,
-                           cpump->mode, cpump->refcnt);
+                           event->attr.config, event->cpu,
+                           cpump->active_events, cpump->mode, cpump->refcnt);
        if (!--cpump->refcnt) {
                debug_sprintf_event(cfm_dbg, 4, "%s page %#lx save %p\n",
                                    __func__, (unsigned long)cpump->page,
@@ -174,7 +174,7 @@ unlock:
        }
        debug_sprintf_event(cfm_dbg, 5, "%s sample_period %#llx users %d"
                            " mode %d refcnt %d page %#lx save %p rc %d\n",
-                           __func__, a->sample_period, cpump->users,
+                           __func__, a->sample_period, cpump->active_events,
                            cpump->mode, cpump->refcnt,
                            (unsigned long)cpump->page, cpump->save, rc);
        mutex_unlock(&pai_reserve_mutex);
@@ -260,7 +260,7 @@ static int paicrypt_add(struct perf_event *event, int flags)
        struct paicrypt_map *cpump = this_cpu_ptr(&paicrypt_map);
        unsigned long ccd;
 
-       if (cpump->users++ == 0) {
+       if (++cpump->active_events == 1) {
                ccd = virt_to_phys(cpump->page) | PAI_CRYPTO_KERNEL_OFFSET;
                WRITE_ONCE(S390_lowcore.ccd, ccd);
                __ctl_set_bit(0, 50);
@@ -291,7 +291,7 @@ static void paicrypt_del(struct perf_event *event, int flags)
        if (!event->attr.sample_period)
                /* Only counting needs to read counter */
                paicrypt_stop(event, PERF_EF_UPDATE);
-       if (cpump->users-- == 1) {
+       if (--cpump->active_events == 0) {
                __ctl_clear_bit(0, 50);
                WRITE_ONCE(S390_lowcore.ccd, 0);
        }