Skip to content

Commit 5dddfaa

Browse files
committed
s390/cpum_cf: move array from header to C file
Move array from header to C file to avoid that it gets defined in every C file where the header is included: In file included from arch/s390/kernel/perf_cpum_cf_common.c:19: ./arch/s390/include/asm/cpu_mcf.h:27:18: warning: ‘cpumf_ctr_ctl’ defined but not used [-Wunused-const-variable=] 27 | static const u64 cpumf_ctr_ctl[CPUMF_CTR_SET_MAX] = { | ^~~~~~~~~~~~~ Signed-off-by: Heiko Carstens <[email protected]>
1 parent 2e82752 commit 5dddfaa

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

arch/s390/include/asm/cpu_mcf.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ enum cpumf_ctr_set {
2424

2525
#define CPUMF_LCCTL_ENABLE_SHIFT 16
2626
#define CPUMF_LCCTL_ACTCTL_SHIFT 0
27-
static const u64 cpumf_ctr_ctl[CPUMF_CTR_SET_MAX] = {
28-
[CPUMF_CTR_SET_BASIC] = 0x02,
29-
[CPUMF_CTR_SET_USER] = 0x04,
30-
[CPUMF_CTR_SET_CRYPTO] = 0x08,
31-
[CPUMF_CTR_SET_EXT] = 0x01,
32-
[CPUMF_CTR_SET_MT_DIAG] = 0x20,
33-
};
3427

3528
static inline void ctr_set_enable(u64 *state, u64 ctrsets)
3629
{

arch/s390/kernel/perf_cpum_cf.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ static size_t cfdiag_getctrset(struct cf_ctrset_entry *ctrdata, int ctrset,
158158
return need;
159159
}
160160

161+
static const u64 cpumf_ctr_ctl[CPUMF_CTR_SET_MAX] = {
162+
[CPUMF_CTR_SET_BASIC] = 0x02,
163+
[CPUMF_CTR_SET_USER] = 0x04,
164+
[CPUMF_CTR_SET_CRYPTO] = 0x08,
165+
[CPUMF_CTR_SET_EXT] = 0x01,
166+
[CPUMF_CTR_SET_MT_DIAG] = 0x20,
167+
};
168+
161169
/* Read out all counter sets and save them in the provided data buffer.
162170
* The last 64 byte host an artificial trailer entry.
163171
*/

0 commit comments

Comments
 (0)