[PATCH kvm-unit-tests] arm/arm64: Make code compilable with -Wmissing-prototypes

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

 



Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
---
 lib/arm/asm/setup.h   | 2 ++
 lib/arm/delay.c       | 1 +
 lib/arm/eabi_compat.c | 5 +++++
 lib/arm/io.c          | 2 ++
 lib/arm/io.h          | 7 +++++++
 lib/arm/processor.c   | 3 +++
 lib/arm/setup.c       | 3 ++-
 lib/arm/smp.c         | 3 +++
 lib/arm64/processor.c | 3 +++
 lib/chr-testdev.c     | 2 ++
 x86/sieve.c           | 4 ++--
 11 files changed, 32 insertions(+), 3 deletions(-)
 create mode 100644 lib/arm/io.h

diff --git a/lib/arm/asm/setup.h b/lib/arm/asm/setup.h
index 42bf9ba8c716..fe9b15f70cd4 100644
--- a/lib/arm/asm/setup.h
+++ b/lib/arm/asm/setup.h
@@ -33,4 +33,6 @@ extern phys_addr_t __phys_offset, __phys_end;
 #define L1_CACHE_BYTES		(1 << L1_CACHE_SHIFT)
 #define SMP_CACHE_BYTES		L1_CACHE_BYTES
 
+void setup(const void *fdt);
+
 #endif /* _ASMARM_SETUP_H_ */
diff --git a/lib/arm/delay.c b/lib/arm/delay.c
index fa65e2dc9e35..80e63860f2dd 100644
--- a/lib/arm/delay.c
+++ b/lib/arm/delay.c
@@ -8,6 +8,7 @@
 #include <libcflat.h>
 #include <asm/processor.h>
 #include <asm/barrier.h>
+#include <asm/delay.h>
 
 void delay(u64 cycles)
 {
diff --git a/lib/arm/eabi_compat.c b/lib/arm/eabi_compat.c
index 9d0ca6656eda..c4071ccef03e 100644
--- a/lib/arm/eabi_compat.c
+++ b/lib/arm/eabi_compat.c
@@ -7,6 +7,11 @@
  */
 #include <libcflat.h>
 
+/* Needed to compile with -Wmissing-prototypes */
+int raise(int signum);
+void __aeabi_unwind_cpp_pr0(void);
+void __aeabi_unwind_cpp_pr1(void);
+
 int raise(int signum __unused)
 {
 	printf("Divide by zero!\n");
diff --git a/lib/arm/io.c b/lib/arm/io.c
index a111530f4802..603456f7ba00 100644
--- a/lib/arm/io.c
+++ b/lib/arm/io.c
@@ -14,6 +14,8 @@
 #include <asm/spinlock.h>
 #include <asm/io.h>
 
+#include "io.h"
+
 extern void halt(int code);
 
 /*
diff --git a/lib/arm/io.h b/lib/arm/io.h
new file mode 100644
index 000000000000..2746d72e8280
--- /dev/null
+++ b/lib/arm/io.h
@@ -0,0 +1,7 @@
+/*
+ * Prototypes for io.c
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.
+ */
+
+extern void io_init(void);
diff --git a/lib/arm/processor.c b/lib/arm/processor.c
index 49e852c06527..773337e6d3b7 100644
--- a/lib/arm/processor.c
+++ b/lib/arm/processor.c
@@ -73,6 +73,9 @@ void install_exception_handler(enum vector v, exception_fn fn)
 		ti->exception_handlers[v] = fn;
 }
 
+/* Needed to compile with -Wmissing-prototypes */
+void do_handle_exception(enum vector v, struct pt_regs *regs);
+
 void do_handle_exception(enum vector v, struct pt_regs *regs)
 {
 	struct thread_info *ti = thread_info_sp(regs->ARM_sp);
diff --git a/lib/arm/setup.c b/lib/arm/setup.c
index d9458a888b55..4f02fca85607 100644
--- a/lib/arm/setup.c
+++ b/lib/arm/setup.c
@@ -22,8 +22,9 @@
 #include <asm/page.h>
 #include <asm/smp.h>
 
+#include "io.h"
+
 extern unsigned long stacktop;
-extern void io_init(void);
 
 char *initrd;
 u32 initrd_size;
diff --git a/lib/arm/smp.c b/lib/arm/smp.c
index 3a4151e2da12..98a5054e039b 100644
--- a/lib/arm/smp.c
+++ b/lib/arm/smp.c
@@ -28,6 +28,9 @@ struct secondary_data {
 struct secondary_data secondary_data;
 static struct spinlock lock;
 
+/* Needed to compile with -Wmissing-prototypes */
+secondary_entry_fn secondary_cinit(void);
+
 secondary_entry_fn secondary_cinit(void)
 {
 	struct thread_info *ti = current_thread_info();
diff --git a/lib/arm64/processor.c b/lib/arm64/processor.c
index 96995ccb7733..2a024e3f4e9d 100644
--- a/lib/arm64/processor.c
+++ b/lib/arm64/processor.c
@@ -194,6 +194,9 @@ void vector_handlers_default_init(vector_fn *handlers)
 	handlers[EL0_IRQ_64]	= default_vector_irq_handler;
 }
 
+/* Needed to compile with -Wmissing-prototypes */
+void do_handle_exception(enum vector v, struct pt_regs *regs, unsigned int esr);
+
 void do_handle_exception(enum vector v, struct pt_regs *regs, unsigned int esr)
 {
 	struct thread_info *ti = thread_info_sp(regs->sp);
diff --git a/lib/chr-testdev.c b/lib/chr-testdev.c
index 145082631000..6890f63c8b29 100644
--- a/lib/chr-testdev.c
+++ b/lib/chr-testdev.c
@@ -7,6 +7,8 @@
 #include "virtio.h"
 #include "asm/spinlock.h"
 
+#include "chr-testdev.h"
+
 #define TESTDEV_NAME "chr-testdev"
 
 static struct virtio_device *vcon;
diff --git a/x86/sieve.c b/x86/sieve.c
index 2ee291962c75..116cb9d7b585 100644
--- a/x86/sieve.c
+++ b/x86/sieve.c
@@ -1,7 +1,7 @@
 #include "alloc.h"
 #include "libcflat.h"
 
-int sieve(char* data, int size)
+static int sieve(char* data, int size)
 {
     int i, j, r = 0;
 
@@ -19,7 +19,7 @@ int sieve(char* data, int size)
     return r;
 }
 
-void test_sieve(const char *msg, char *data, int size)
+static void test_sieve(const char *msg, char *data, int size)
 {
     int r;
 
-- 
2.13.6




[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