Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/pai: move enum definition to header file

Move enum definition to header file. This is done in preparation
for a follow on patch where this enum will be used in another source
file.
Also change the enum name from paiext_mode to paievt_mode
to indicate this enum is now used for several events.
Make naming consistent and rename PAI_MODE_COUNTER to PAI_MODE_COUNTING.

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>

authored by

Thomas Richter and committed by
Vasily Gorbik
4c787963 55af33fd

+9 -9
+6
arch/s390/include/asm/pai.h
··· 75 75 WRITE_ONCE(S390_lowcore.ccd, S390_lowcore.ccd & ~PAI_CRYPTO_KERNEL_OFFSET); 76 76 } 77 77 78 + enum paievt_mode { 79 + PAI_MODE_NONE, 80 + PAI_MODE_SAMPLING, 81 + PAI_MODE_COUNTING, 82 + }; 83 + 78 84 #endif
+3 -9
arch/s390/kernel/perf_pai_ext.c
··· 28 28 static debug_info_t *paiext_dbg; 29 29 static unsigned int paiext_cnt; /* Extracted with QPACI instruction */ 30 30 31 - enum paiext_mode { 32 - PAI_MODE_NONE, 33 - PAI_MODE_SAMPLING, 34 - PAI_MODE_COUNTER, 35 - }; 36 - 37 31 struct pai_userdata { 38 32 u16 num; 39 33 u64 value; ··· 48 54 struct paiext_map { 49 55 unsigned long *area; /* Area for CPU to store counters */ 50 56 struct pai_userdata *save; /* Area to store non-zero counters */ 51 - enum paiext_mode mode; /* Type of event */ 57 + enum paievt_mode mode; /* Type of event */ 52 58 unsigned int active_events; /* # of PAI Extension users */ 53 59 unsigned int refcnt; 54 60 struct perf_event *event; /* Perf event for sampling */ ··· 186 192 goto unlock; 187 193 } 188 194 cpump->mode = a->sample_period ? PAI_MODE_SAMPLING 189 - : PAI_MODE_COUNTER; 195 + : PAI_MODE_COUNTING; 190 196 } else { 191 197 /* Multiple invocation, check whats active. 192 198 * Supported are multiple counter events or only one sampling 193 199 * event concurrently at any one time. 194 200 */ 195 201 if (cpump->mode == PAI_MODE_SAMPLING || 196 - (cpump->mode == PAI_MODE_COUNTER && a->sample_period)) { 202 + (cpump->mode == PAI_MODE_COUNTING && a->sample_period)) { 197 203 rc = -EBUSY; 198 204 goto unlock; 199 205 }