summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Richter <tmricht@linux.ibm.com>2023-01-24 12:20:55 +0100
committerHeiko Carstens <hca@linux.ibm.com>2023-01-25 20:51:10 +0100
commit0d5f0dc83073cd36d1e92bbcbcc3bc046918bc69 (patch)
treeb2eef750df47d7abc16aed22bc78fed8b99a9a9f
parent1e99c242acb2fc211aa9f57cd1060622e66bbf63 (diff)
downloadlinux-0d5f0dc83073cd36d1e92bbcbcc3bc046918bc69.tar.gz
linux-0d5f0dc83073cd36d1e92bbcbcc3bc046918bc69.tar.bz2
linux-0d5f0dc83073cd36d1e92bbcbcc3bc046918bc69.zip
s390/cpum_cf: simplify PMC_INIT and PMC_RELEASE usage
Simplify the use of constants PMC_INIT and PMC_RELEASE. Suggested-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
-rw-r--r--arch/s390/kernel/perf_cpum_cf.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c
index 940c717e6531..0cbca3165496 100644
--- a/arch/s390/kernel/perf_cpum_cf.c
+++ b/arch/s390/kernel/perf_cpum_cf.c
@@ -506,14 +506,14 @@ static void cpumf_pmu_disable(struct pmu *pmu)
cpuhw->flags &= ~PMU_F_ENABLED;
}
-#define PMC_INIT 0
-#define PMC_RELEASE 1
+#define PMC_INIT 0UL
+#define PMC_RELEASE 1UL
static void cpum_cf_setup_cpu(void *flags)
{
struct cpu_cf_events *cpuhw = this_cpu_ptr(&cpu_cf_events);
- switch (*((int *)flags)) {
+ switch ((unsigned long)flags) {
case PMC_INIT:
memset(&cpuhw->info, 0, sizeof(cpuhw->info));
qctri(&cpuhw->info);
@@ -535,9 +535,7 @@ static void cpum_cf_setup_cpu(void *flags)
/* Initialize the CPU-measurement counter facility */
static int __kernel_cpumcf_begin(void)
{
- int flags = PMC_INIT;
-
- on_each_cpu(cpum_cf_setup_cpu, &flags, 1);
+ on_each_cpu(cpum_cf_setup_cpu, (void *)PMC_INIT, 1);
irq_subclass_register(IRQ_SUBCLASS_MEASUREMENT_ALERT);
return 0;
@@ -546,9 +544,7 @@ static int __kernel_cpumcf_begin(void)
/* Release the CPU-measurement counter facility */
static void __kernel_cpumcf_end(void)
{
- int flags = PMC_RELEASE;
-
- on_each_cpu(cpum_cf_setup_cpu, &flags, 1);
+ on_each_cpu(cpum_cf_setup_cpu, (void *)PMC_RELEASE, 1);
irq_subclass_unregister(IRQ_SUBCLASS_MEASUREMENT_ALERT);
}
@@ -937,10 +933,10 @@ static struct pmu cpumf_pmu = {
.read = cpumf_pmu_read,
};
-static int cpum_cf_setup(unsigned int cpu, int flags)
+static int cpum_cf_setup(unsigned int cpu, unsigned long flags)
{
local_irq_disable();
- cpum_cf_setup_cpu(&flags);
+ cpum_cf_setup_cpu((void *)flags);
local_irq_enable();
return 0;
}