All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: kvm-ppc@vger.kernel.org
Subject: [kvm-unit-tests PATCH] powerpc: Make code compilable with -Wmissing-prototypes
Date: Mon, 11 Jun 2018 11:41:40 +0000	[thread overview]
Message-ID: <1528717300-27112-1-git-send-email-thuth@redhat.com> (raw)

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

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;
-- 
1.8.3.1


             reply	other threads:[~2018-06-11 11:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-11 11:41 Thomas Huth [this message]
2018-06-11 12:24 ` [kvm-unit-tests PATCH] powerpc: Make code compilable with -Wmissing-prototypes Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1528717300-27112-1-git-send-email-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.