* [kvm-unit-tests PATCH] powerpc: Make code compilable with -Wmissing-prototypes
@ 2018-06-11 11:41 Thomas Huth
2018-06-11 12:24 ` Laurent Vivier
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Huth @ 2018-06-11 11:41 UTC (permalink / raw)
To: kvm-ppc
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [kvm-unit-tests PATCH] powerpc: Make code compilable with -Wmissing-prototypes
2018-06-11 11:41 [kvm-unit-tests PATCH] powerpc: Make code compilable with -Wmissing-prototypes Thomas Huth
@ 2018-06-11 12:24 ` Laurent Vivier
0 siblings, 0 replies; 2+ messages in thread
From: Laurent Vivier @ 2018-06-11 12:24 UTC (permalink / raw)
To: kvm-ppc
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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-06-11 12:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-11 11:41 [kvm-unit-tests PATCH] powerpc: Make code compilable with -Wmissing-prototypes Thomas Huth
2018-06-11 12:24 ` Laurent Vivier
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.