mirror of https://github.com/torvalds/linux.git
s390/pai_crypto: Rename paicrypt_root_alloc() and paicrypt_root_free()
To support one common PAI PMU device driver which handles both PMUs pai_crypto and pai_ext, use a common naming scheme for structures and variables suitable for both device drivers. Rename functions paicrypt_root_alloc() and paicrypt_root_free() to pai_root_alloc() and pai_root_free(). No functional change. Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Reviewed-by: Jan Polensky <japo@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
parent
3f082c2e47
commit
387c7b5f04
|
|
@ -49,7 +49,7 @@ static struct pai_root { /* Anchor to per CPU data */
|
||||||
} pai_root;
|
} pai_root;
|
||||||
|
|
||||||
/* Free per CPU data when the last event is removed. */
|
/* Free per CPU data when the last event is removed. */
|
||||||
static void paicrypt_root_free(void)
|
static void pai_root_free(void)
|
||||||
{
|
{
|
||||||
if (refcount_dec_and_test(&pai_root.refcnt)) {
|
if (refcount_dec_and_test(&pai_root.refcnt)) {
|
||||||
free_percpu(pai_root.mapptr);
|
free_percpu(pai_root.mapptr);
|
||||||
|
|
@ -65,7 +65,7 @@ static void paicrypt_root_free(void)
|
||||||
* CPUs possible, which might be larger than the number of CPUs currently
|
* CPUs possible, which might be larger than the number of CPUs currently
|
||||||
* online.
|
* online.
|
||||||
*/
|
*/
|
||||||
static int paicrypt_root_alloc(void)
|
static int pai_root_alloc(void)
|
||||||
{
|
{
|
||||||
if (!refcount_inc_not_zero(&pai_root.refcnt)) {
|
if (!refcount_inc_not_zero(&pai_root.refcnt)) {
|
||||||
/* The memory is already zeroed. */
|
/* The memory is already zeroed. */
|
||||||
|
|
@ -104,7 +104,7 @@ static void paicrypt_event_destroy_cpu(struct perf_event *event, int cpu)
|
||||||
refcount_read(&cpump->refcnt));
|
refcount_read(&cpump->refcnt));
|
||||||
if (refcount_dec_and_test(&cpump->refcnt))
|
if (refcount_dec_and_test(&cpump->refcnt))
|
||||||
paicrypt_free(mp);
|
paicrypt_free(mp);
|
||||||
paicrypt_root_free();
|
pai_root_free();
|
||||||
mutex_unlock(&pai_reserve_mutex);
|
mutex_unlock(&pai_reserve_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -185,7 +185,7 @@ static int paicrypt_alloc_cpu(struct perf_event *event, int cpu)
|
||||||
|
|
||||||
mutex_lock(&pai_reserve_mutex);
|
mutex_lock(&pai_reserve_mutex);
|
||||||
/* Allocate root node */
|
/* Allocate root node */
|
||||||
rc = paicrypt_root_alloc();
|
rc = pai_root_alloc();
|
||||||
if (rc)
|
if (rc)
|
||||||
goto unlock;
|
goto unlock;
|
||||||
|
|
||||||
|
|
@ -222,7 +222,7 @@ static int paicrypt_alloc_cpu(struct perf_event *event, int cpu)
|
||||||
* the event in not created, its destroy() function is never
|
* the event in not created, its destroy() function is never
|
||||||
* invoked. Adjust the reference counter for the anchor.
|
* invoked. Adjust the reference counter for the anchor.
|
||||||
*/
|
*/
|
||||||
paicrypt_root_free();
|
pai_root_free();
|
||||||
}
|
}
|
||||||
unlock:
|
unlock:
|
||||||
mutex_unlock(&pai_reserve_mutex);
|
mutex_unlock(&pai_reserve_mutex);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue