public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: linux-mips@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Stephen Rothwell" <sfr@rothwell.id.au>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>
Subject: [PATCH 01/20] mips: decompress: fix add missing prototypes
Date: Mon,  4 Dec 2023 12:56:51 +0100	[thread overview]
Message-ID: <20231204115710.2247097-2-arnd@kernel.org> (raw)
In-Reply-To: <20231204115710.2247097-1-arnd@kernel.org>

From: Arnd Bergmann <arnd@arndb.de>

The mips decompressor has some string functions defined locally that are not
declared in the right place:

arch/mips/boot/compressed/dbg.c:12:13: error: no previous prototype for 'putc' [-Werror=missing-prototypes]
arch/mips/boot/compressed/dbg.c:16:6: error: no previous prototype for 'puts' [-Werror=missing-prototypes]
arch/mips/boot/compressed/dbg.c:26:6: error: no previous prototype for 'puthex' [-Werror=missing-prototypes]
arch/mips/boot/compressed/string.c:11:7: error: no previous prototype for 'memcpy' [-Werror=missing-prototypes]
arch/mips/boot/compressed/string.c:22:7: error: no previous prototype for 'memset' [-Werror=missing-prototypes]
arch/mips/boot/compressed/string.c:32:15: error: no previous prototype for 'memmove' [-Werror=missing-prototypes]
arch/mips/boot/compressed/decompress.c:43:6: error: no previous prototype for 'error' [-Werror=missing-prototypes]
arch/mips/boot/compressed/decompress.c:91:6: error: no previous prototype for 'decompress_kernel' [-Werror=missing-prototypes]

Include the string.h header where needed and add a decompress.h header to
have shared prototypes for the rest.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/mips/boot/compressed/dbg.c        |  2 ++
 arch/mips/boot/compressed/decompress.c | 16 ++--------------
 arch/mips/boot/compressed/decompress.h | 24 ++++++++++++++++++++++++
 arch/mips/boot/compressed/string.c     |  1 +
 4 files changed, 29 insertions(+), 14 deletions(-)
 create mode 100644 arch/mips/boot/compressed/decompress.h

diff --git a/arch/mips/boot/compressed/dbg.c b/arch/mips/boot/compressed/dbg.c
index f6728a8fd1c3..2f1ac38fe1cc 100644
--- a/arch/mips/boot/compressed/dbg.c
+++ b/arch/mips/boot/compressed/dbg.c
@@ -9,6 +9,8 @@
 #include <linux/compiler.h>
 #include <linux/types.h>
 
+#include "decompress.h"
+
 void __weak putc(char c)
 {
 }
diff --git a/arch/mips/boot/compressed/decompress.c b/arch/mips/boot/compressed/decompress.c
index c5dd415254d3..adb6d5b0e6eb 100644
--- a/arch/mips/boot/compressed/decompress.c
+++ b/arch/mips/boot/compressed/decompress.c
@@ -19,6 +19,8 @@
 #include <asm/unaligned.h>
 #include <asm-generic/vmlinux.lds.h>
 
+#include "decompress.h"
+
 /*
  * These two variables specify the free mem region
  * that can be used for temporary malloc area
@@ -26,20 +28,6 @@
 unsigned long free_mem_ptr;
 unsigned long free_mem_end_ptr;
 
-/* The linker tells us where the image is. */
-extern unsigned char __image_begin[], __image_end[];
-
-/* debug interfaces  */
-#ifdef CONFIG_DEBUG_ZBOOT
-extern void puts(const char *s);
-extern void puthex(unsigned long long val);
-#else
-#define puts(s) do {} while (0)
-#define puthex(val) do {} while (0)
-#endif
-
-extern char __appended_dtb[];
-
 void error(char *x)
 {
 	puts("\n\n");
diff --git a/arch/mips/boot/compressed/decompress.h b/arch/mips/boot/compressed/decompress.h
new file mode 100644
index 000000000000..073b64593b3d
--- /dev/null
+++ b/arch/mips/boot/compressed/decompress.h
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: GPL-2.0
+#ifndef _DECOMPRESSOR_H
+#define _DECOMPRESSOR_H
+
+/* The linker tells us where the image is. */
+extern unsigned char __image_begin[], __image_end[];
+
+/* debug interfaces  */
+#ifdef CONFIG_DEBUG_ZBOOT
+extern void putc(char c);
+extern void puts(const char *s);
+extern void puthex(unsigned long long val);
+#else
+#define putc(s) do {} while (0)
+#define puts(s) do {} while (0)
+#define puthex(val) do {} while (0)
+#endif
+
+extern char __appended_dtb[];
+
+void error(char *x);
+void decompress_kernel(unsigned long boot_heap_start);
+
+#endif
diff --git a/arch/mips/boot/compressed/string.c b/arch/mips/boot/compressed/string.c
index 0b593b709228..f0eb251e44e5 100644
--- a/arch/mips/boot/compressed/string.c
+++ b/arch/mips/boot/compressed/string.c
@@ -7,6 +7,7 @@
 
 #include <linux/compiler_attributes.h>
 #include <linux/types.h>
+#include <asm/string.h>
 
 void *memcpy(void *dest, const void *src, size_t n)
 {
-- 
2.39.2


  reply	other threads:[~2023-12-04 11:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-04 11:56 [PATCH 00/20] mips: address -Wmissing-prototypes warnings Arnd Bergmann
2023-12-04 11:56 ` Arnd Bergmann [this message]
2023-12-04 11:56 ` [PATCH 02/20] mips: add asm/syscalls.h header Arnd Bergmann
2023-12-04 11:56 ` [PATCH 03/20] mips: add missing declarations for trap handlers Arnd Bergmann
2023-12-04 11:56 ` [PATCH 04/20] mips: rs870e: stop exporting local functions Arnd Bergmann
2023-12-04 11:56 ` [PATCH 05/20] mips: signal: move sigcontext declarations to header Arnd Bergmann
2023-12-04 11:56 ` [PATCH 06/20] mips: mark local function static if possible Arnd Bergmann
2023-12-04 11:56 ` [PATCH 07/20] mips: move build_tlb_refill_handler() prototype Arnd Bergmann
2023-12-04 11:56 ` [PATCH 08/20] mips: move jump_label_apply_nops() declaration to header Arnd Bergmann
2023-12-04 11:56 ` [PATCH 09/20] mips: unhide uasm_in_compat_space_p() declaration Arnd Bergmann
2023-12-04 11:57 ` [PATCH 10/20] mips: fix setup_zero_pages() prototype Arnd Bergmann
2023-12-04 11:57 ` [PATCH 11/20] mips: fix tlb_init() prototype Arnd Bergmann
2023-12-04 11:57 ` [PATCH 12/20] mips: move cache declarations into header Arnd Bergmann
2023-12-04 11:57 ` [PATCH 13/20] mips: add missing declarations Arnd Bergmann
2023-12-04 11:57 ` [PATCH 14/20] mips: spram: fix missing prototype warning for spram_config Arnd Bergmann
2023-12-04 11:57 ` [PATCH 15/20] mips: mt: include asm/mips_mt.h Arnd Bergmann
2023-12-04 11:57 ` [PATCH 16/20] mips: remove extraneous asm-generic/iomap.h include Arnd Bergmann
2023-12-04 11:57 ` [PATCH 17/20] mips: suspend: include linux/suspend.h as needed Arnd Bergmann
2023-12-04 11:57 ` [PATCH 18/20] mips: hide conditionally unused functions Arnd Bergmann
2023-12-04 11:57 ` [PATCH 19/20] mips: smp: fix setup_profiling_timer() prototype Arnd Bergmann
2023-12-04 11:57 ` [PATCH 20/20] mips: kexec: include linux/reboot.h Arnd Bergmann
2023-12-05 11:00 ` [PATCH 00/20] mips: address -Wmissing-prototypes warnings Thomas Bogendoerfer

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=20231204115710.2247097-2-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=sfr@rothwell.id.au \
    --cc=tsbogend@alpha.franken.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox