diff mbox series

[kvm-unit-tests] powerpc: Make code compilable with -Wmissing-prototypes

Message ID 1528717300-27112-1-git-send-email-thuth@redhat.com
State Accepted
Headers show
Series [kvm-unit-tests] powerpc: Make code compilable with -Wmissing-prototypes | expand

Commit Message

Thomas Huth June 11, 2018, 11:41 a.m. UTC
It's always better to check whether the implementations match the
prototypes, so make the code compilable with the -Wmissing-prototypes
compiler flag. (However, the flag is not turned on yet since the other
architectures are not ready for this yet)

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 lib/powerpc/asm/setup.h | 2 ++
 lib/powerpc/hcall.c     | 2 ++
 lib/powerpc/io.c        | 3 ++-
 lib/powerpc/io.h        | 8 ++++++++
 lib/powerpc/setup.c     | 2 +-
 powerpc/reloc64.c       | 2 ++
 6 files changed, 17 insertions(+), 2 deletions(-)
 create mode 100644 lib/powerpc/io.h

Comments

Laurent Vivier June 11, 2018, 12:24 p.m. UTC | #1
On 11/06/2018 13:41, Thomas Huth wrote:
> It's always better to check whether the implementations match the
> prototypes, so make the code compilable with the -Wmissing-prototypes
> compiler flag. (However, the flag is not turned on yet since the other
> architectures are not ready for this yet)
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  lib/powerpc/asm/setup.h | 2 ++
>  lib/powerpc/hcall.c     | 2 ++
>  lib/powerpc/io.c        | 3 ++-
>  lib/powerpc/io.h        | 8 ++++++++
>  lib/powerpc/setup.c     | 2 +-
>  powerpc/reloc64.c       | 2 ++
>  6 files changed, 17 insertions(+), 2 deletions(-)
>  create mode 100644 lib/powerpc/io.h

Reviewed-by: Laurent Vivier <lvivier@redhat.com>


--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox series

Patch

diff --git a/lib/powerpc/asm/setup.h b/lib/powerpc/asm/setup.h
index 23b4156..cc7cf5e 100644
--- a/lib/powerpc/asm/setup.h
+++ b/lib/powerpc/asm/setup.h
@@ -27,4 +27,6 @@  extern unsigned __icache_bytes, __dcache_bytes;
 #define PHYSICAL_START		(__physical_start)
 #define PHYSICAL_END		(__physical_end)
 
+void setup(const void *fdt);
+
 #endif /* _ASMPOWERPC_SETUP_H_ */
diff --git a/lib/powerpc/hcall.c b/lib/powerpc/hcall.c
index 7b05265..711cb1b 100644
--- a/lib/powerpc/hcall.c
+++ b/lib/powerpc/hcall.c
@@ -9,6 +9,8 @@ 
  * This work is licensed under the terms of the GNU LGPL, version 2.
  */
 #include <asm/hcall.h>
+#include <libcflat.h>
+#include "io.h"
 
 int hcall_have_broken_sc1(void)
 {
diff --git a/lib/powerpc/io.c b/lib/powerpc/io.c
index 6a94bcc..915e12e 100644
--- a/lib/powerpc/io.c
+++ b/lib/powerpc/io.c
@@ -8,9 +8,10 @@ 
 #include <libcflat.h>
 #include <asm/spinlock.h>
 #include <asm/rtas.h>
+#include <asm/setup.h>
+#include "io.h"
 
 extern void halt(int code);
-extern void putchar(int c);
 
 static struct spinlock print_lock;
 
diff --git a/lib/powerpc/io.h b/lib/powerpc/io.h
new file mode 100644
index 0000000..1f5a7bd
--- /dev/null
+++ b/lib/powerpc/io.h
@@ -0,0 +1,8 @@ 
+/*
+ * Prototypes for io.c
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2.
+ */
+
+extern void io_init(void);
+extern void putchar(int c);
diff --git a/lib/powerpc/setup.c b/lib/powerpc/setup.c
index d8f4327..1be4c03 100644
--- a/lib/powerpc/setup.c
+++ b/lib/powerpc/setup.c
@@ -19,9 +19,9 @@ 
 #include <asm/setup.h>
 #include <asm/page.h>
 #include <asm/hcall.h>
+#include "io.h"
 
 extern unsigned long stacktop;
-extern void io_init(void);
 
 char *initrd;
 u32 initrd_size;
diff --git a/powerpc/reloc64.c b/powerpc/reloc64.c
index d919372..f6aaabe 100644
--- a/powerpc/reloc64.c
+++ b/powerpc/reloc64.c
@@ -24,6 +24,8 @@  struct elf64_rela {
 	signed long long addend;
 };
 
+void relocate(unsigned long load_addr, struct elf64_dyn *dyn_table);
+
 void relocate(unsigned long load_addr, struct elf64_dyn *dyn_table)
 {
 	unsigned long long rela_addr = 0, rela_count = 0, *addr;