Skip to content

Commit 9d1f3aa

Browse files
arndbRussell King (Oracle)
authored andcommitted
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 <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent c9a1d4f commit 9d1f3aa

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

arch/arm/boot/compressed/atags_to_fdt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <linux/libfdt_env.h>
33
#include <asm/setup.h>
44
#include <libfdt.h>
5+
#include "misc.h"
56

67
#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND)
78
#define do_extend_cmdline 1

arch/arm/boot/compressed/fdt_check_mem_start.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <linux/kernel.h>
44
#include <linux/libfdt.h>
55
#include <linux/sizes.h>
6+
#include "misc.h"
67

78
static const void *get_prop(const void *fdt, const char *node_path,
89
const char *property, int minlen)

arch/arm/boot/compressed/misc.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ static void putstr(const char *ptr)
103103
/*
104104
* gzip declarations
105105
*/
106-
extern char input_data[];
107-
extern char input_data_end[];
108-
109106
unsigned char *output_data;
110107

111108
unsigned long free_mem_ptr;
@@ -131,9 +128,6 @@ asmlinkage void __div0(void)
131128
error("Attempting division by 0!");
132129
}
133130

134-
extern int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x));
135-
136-
137131
void
138132
decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
139133
unsigned long free_mem_ptr_end_p,

arch/arm/boot/compressed/misc.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,16 @@
66
void error(char *x) __noreturn;
77
extern unsigned long free_mem_ptr;
88
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[];
920

1021
#endif

0 commit comments

Comments
 (0)