[PATCH kvm-unit-tests v2 1/8] arm/arm64: smp: give on_cpus an argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
---
 arm/gic.c           | 4 ++--
 arm/selftest.c      | 4 ++--
 arm/spinlock-test.c | 4 ++--
 lib/arm/asm/smp.h   | 2 +-
 lib/arm/smp.c       | 9 ++++-----
 5 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/arm/gic.c b/arm/gic.c
index 2c5832100e0e..a945f7ab8385 100644
--- a/arm/gic.c
+++ b/arm/gic.c
@@ -240,7 +240,7 @@ static void ipi_recv(void)
 		wfi();
 }
 
-static void ipi_test(void)
+static void ipi_test(void *data __unused)
 {
 	if (smp_processor_id() == IPI_SENDER)
 		ipi_send();
@@ -327,7 +327,7 @@ int main(int argc, char **argv)
 	if (strcmp(argv[1], "ipi") == 0) {
 		report_prefix_push(argv[1]);
 		nr_cpu_check(2);
-		on_cpus(ipi_test);
+		on_cpus(ipi_test, NULL);
 	} else if (strcmp(argv[1], "active") == 0) {
 		run_active_clear_test();
 	} else {
diff --git a/arm/selftest.c b/arm/selftest.c
index 1ad2e7120248..ea5101ef7217 100644
--- a/arm/selftest.c
+++ b/arm/selftest.c
@@ -308,7 +308,7 @@ static bool psci_check(void)
 	return true;
 }
 
-static void cpu_report(void)
+static void cpu_report(void *data __unused)
 {
 	uint64_t mpidr = get_mpidr();
 	int cpu = smp_processor_id();
@@ -342,7 +342,7 @@ int main(int argc, char **argv)
 	} else if (strcmp(argv[1], "smp") == 0) {
 
 		report("PSCI version", psci_check());
-		on_cpus(cpu_report);
+		on_cpus(cpu_report, NULL);
 
 	} else {
 		printf("Unknown subtest\n");
diff --git a/arm/spinlock-test.c b/arm/spinlock-test.c
index cd03f81c5fae..d55471bc0aa3 100644
--- a/arm/spinlock-test.c
+++ b/arm/spinlock-test.c
@@ -43,7 +43,7 @@ static void none_unlock(int *lock_var)
 static int global_a, global_b;
 static int global_lock;
 
-static void test_spinlock(void)
+static void test_spinlock(void *data __unused)
 {
 	int i, errors = 0;
 	int cpu = smp_processor_id();
@@ -80,7 +80,7 @@ int main(int argc, char **argv)
 		lock_ops.unlock = none_unlock;
 	}
 
-	on_cpus(test_spinlock);
+	on_cpus(test_spinlock, NULL);
 
 	return report_summary();
 }
diff --git a/lib/arm/asm/smp.h b/lib/arm/asm/smp.h
index 62d14b07bc51..077afde85520 100644
--- a/lib/arm/asm/smp.h
+++ b/lib/arm/asm/smp.h
@@ -52,6 +52,6 @@ typedef void (*secondary_entry_fn)(void);
 extern void smp_boot_secondary(int cpu, secondary_entry_fn entry);
 extern void on_cpu_async(int cpu, void (*func)(void *data), void *data);
 extern void on_cpu(int cpu, void (*func)(void *data), void *data);
-extern void on_cpus(void (*func)(void));
+extern void on_cpus(void (*func)(void *data), void *data);
 
 #endif /* _ASMARM_SMP_H_ */
diff --git a/lib/arm/smp.c b/lib/arm/smp.c
index 5a6209ebcbfd..3c4e307489b2 100644
--- a/lib/arm/smp.c
+++ b/lib/arm/smp.c
@@ -72,9 +72,8 @@ void smp_boot_secondary(int cpu, secondary_entry_fn entry)
 	spin_unlock(&lock);
 }
 
-typedef void (*on_cpu_func)(void *);
 struct on_cpu_info {
-	on_cpu_func func;
+	void (*func)(void *data);
 	void *data;
 	cpumask_t waiters;
 };
@@ -180,16 +179,16 @@ void on_cpu(int cpu, void (*func)(void *data), void *data)
 	cpu_wait(cpu);
 }
 
-void on_cpus(void (*func)(void))
+void on_cpus(void (*func)(void *data), void *data)
 {
 	int cpu, me = smp_processor_id();
 
 	for_each_present_cpu(cpu) {
 		if (cpu == me)
 			continue;
-		on_cpu_async(cpu, (on_cpu_func)func, NULL);
+		on_cpu_async(cpu, func, data);
 	}
-	func();
+	func(data);
 
 	for_each_present_cpu(cpu) {
 		if (cpu == me)
-- 
2.9.4




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux