s390/cpum_cf: move cpum_cf_ctrset_size()
authorThomas Richter <tmricht@linux.ibm.com>
Tue, 24 Jan 2023 11:20:51 +0000 (12:20 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Wed, 25 Jan 2023 19:51:09 +0000 (20:51 +0100)
Function cpum_cf_ctrset_size() is defined in one source file and the
only user is in another source file. Move this function to the source
file where it is used and remove its prototype from the header file.
No functional change.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/cpu_mcf.h
arch/s390/kernel/perf_cpum_cf.c
arch/s390/kernel/perf_cpum_cf_common.c

index f87a478..387e169 100644 (file)
@@ -105,8 +105,6 @@ static inline int stccm_avail(void)
        return test_facility(142);
 }
 
-size_t cpum_cf_ctrset_size(enum cpumf_ctr_set ctrset,
-                          struct cpumf_ctr_info *info);
 int cfset_online_cpu(unsigned int cpu);
 int cfset_offline_cpu(unsigned int cpu);
 #endif /* _ASM_S390_CPU_MCF_H */
index e58e494..936eda2 100644 (file)
@@ -112,6 +112,53 @@ static void cfdiag_trailer(struct cf_trailer_entry *te)
        te->timestamp = get_tod_clock_fast();
 }
 
+/*
+ * Return the maximum possible counter set size (in number of 8 byte counters)
+ * depending on type and model number.
+ */
+static size_t cpum_cf_ctrset_size(enum cpumf_ctr_set ctrset,
+                                 struct cpumf_ctr_info *info)
+{
+       size_t ctrset_size = 0;
+
+       switch (ctrset) {
+       case CPUMF_CTR_SET_BASIC:
+               if (info->cfvn >= 1)
+                       ctrset_size = 6;
+               break;
+       case CPUMF_CTR_SET_USER:
+               if (info->cfvn == 1)
+                       ctrset_size = 6;
+               else if (info->cfvn >= 3)
+                       ctrset_size = 2;
+               break;
+       case CPUMF_CTR_SET_CRYPTO:
+               if (info->csvn >= 1 && info->csvn <= 5)
+                       ctrset_size = 16;
+               else if (info->csvn == 6 || info->csvn == 7)
+                       ctrset_size = 20;
+               break;
+       case CPUMF_CTR_SET_EXT:
+               if (info->csvn == 1)
+                       ctrset_size = 32;
+               else if (info->csvn == 2)
+                       ctrset_size = 48;
+               else if (info->csvn >= 3 && info->csvn <= 5)
+                       ctrset_size = 128;
+               else if (info->csvn == 6 || info->csvn == 7)
+                       ctrset_size = 160;
+               break;
+       case CPUMF_CTR_SET_MT_DIAG:
+               if (info->csvn > 3)
+                       ctrset_size = 48;
+               break;
+       case CPUMF_CTR_SET_MAX:
+               break;
+       }
+
+       return ctrset_size;
+}
+
 /* Read a counter set. The counter set number determines the counter set and
  * the CPUM-CF first and second version number determine the number of
  * available counters in each counter set.
index 8ee4867..4824e34 100644 (file)
@@ -156,52 +156,6 @@ static int cpum_cf_offline_cpu(unsigned int cpu)
        return cpum_cf_setup(cpu, PMC_RELEASE);
 }
 
-/* Return the maximum possible counter set size (in number of 8 byte counters)
- * depending on type and model number.
- */
-size_t cpum_cf_ctrset_size(enum cpumf_ctr_set ctrset,
-                          struct cpumf_ctr_info *info)
-{
-       size_t ctrset_size = 0;
-
-       switch (ctrset) {
-       case CPUMF_CTR_SET_BASIC:
-               if (info->cfvn >= 1)
-                       ctrset_size = 6;
-               break;
-       case CPUMF_CTR_SET_USER:
-               if (info->cfvn == 1)
-                       ctrset_size = 6;
-               else if (info->cfvn >= 3)
-                       ctrset_size = 2;
-               break;
-       case CPUMF_CTR_SET_CRYPTO:
-               if (info->csvn >= 1 && info->csvn <= 5)
-                       ctrset_size = 16;
-               else if (info->csvn == 6 || info->csvn == 7)
-                       ctrset_size = 20;
-               break;
-       case CPUMF_CTR_SET_EXT:
-               if (info->csvn == 1)
-                       ctrset_size = 32;
-               else if (info->csvn == 2)
-                       ctrset_size = 48;
-               else if (info->csvn >= 3 && info->csvn <= 5)
-                       ctrset_size = 128;
-               else if (info->csvn == 6 || info->csvn == 7)
-                       ctrset_size = 160;
-               break;
-       case CPUMF_CTR_SET_MT_DIAG:
-               if (info->csvn > 3)
-                       ctrset_size = 48;
-               break;
-       case CPUMF_CTR_SET_MAX:
-               break;
-       }
-
-       return ctrset_size;
-}
-
 static int __init cpum_cf_init(void)
 {
        int rc;