Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 9311/1: decompressor: move function prototypes to misc.h

A number of prototypes are missing for the decompressor, some
of them are in the .c files that contain the callers, but are
invisible at the function definition:

arch/arm/boot/compressed/misc.c:129:17: error: no previous prototype for '__div0' [-Werror=missing-prototypes]
arch/arm/boot/compressed/misc.c:138:1: error: no previous prototype for 'decompress_kernel' [-Werror=missing-prototypes]
arch/arm/boot/compressed/misc.c:163:6: error: no previous prototype for 'fortify_panic' [-Werror=missing-prototypes]
arch/arm/boot/compressed/decompress.c:63:5: error: no previous prototype for 'do_decompress' [-Werror=missing-prototypes]
arch/arm/boot/compressed/fdt_check_mem_start.c:63:10: error: no previous prototype for 'fdt_check_mem_start' [-Werror=missing-prototypes]

Move these all to misc.h so they are visible by the callee as well.

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

authored by

Arnd Bergmann and committed by
Russell King (Oracle)
9d1f3aa6 c9a1d4f6

+13 -6
+1
arch/arm/boot/compressed/atags_to_fdt.c
··· 2 2 #include <linux/libfdt_env.h> 3 3 #include <asm/setup.h> 4 4 #include <libfdt.h> 5 + #include "misc.h" 5 6 6 7 #if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND) 7 8 #define do_extend_cmdline 1
+1
arch/arm/boot/compressed/fdt_check_mem_start.c
··· 3 3 #include <linux/kernel.h> 4 4 #include <linux/libfdt.h> 5 5 #include <linux/sizes.h> 6 + #include "misc.h" 6 7 7 8 static const void *get_prop(const void *fdt, const char *node_path, 8 9 const char *property, int minlen)
-6
arch/arm/boot/compressed/misc.c
··· 103 103 /* 104 104 * gzip declarations 105 105 */ 106 - extern char input_data[]; 107 - extern char input_data_end[]; 108 - 109 106 unsigned char *output_data; 110 107 111 108 unsigned long free_mem_ptr; ··· 127 130 { 128 131 error("Attempting division by 0!"); 129 132 } 130 - 131 - extern int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x)); 132 - 133 133 134 134 void 135 135 decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
+11
arch/arm/boot/compressed/misc.h
··· 6 6 void error(char *x) __noreturn; 7 7 extern unsigned long free_mem_ptr; 8 8 extern unsigned long free_mem_end_ptr; 9 + void __div0(void); 10 + void 11 + decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p, 12 + unsigned long free_mem_ptr_end_p, int arch_id); 13 + void fortify_panic(const char *name); 14 + int atags_to_fdt(void *atag_list, void *fdt, int total_space); 15 + uint32_t fdt_check_mem_start(uint32_t mem_start, const void *fdt); 16 + int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x)); 17 + 18 + extern char input_data[]; 19 + extern char input_data_end[]; 9 20 10 21 #endif