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

ARM: decompressor: fix warning introduced in fortify patch

Commit ee333554fed5 ("ARM: 8749/1: Kconfig: Add ARCH_HAS_FORTIFY_SOURCE")
introduced a new warning:

arch/arm/boot/compressed/misc.c: In function 'fortify_panic':
arch/arm/boot/compressed/misc.c:167:1: error: 'noreturn' function does return [-Werror]

The simple solution would be to make 'error' a noreturn function, but
this causes a prototype mismatch as the function is prototyped in
several .c files. So, move the function prototype to a new header.

There are also a couple of variables that are also declared in several
locations. Clean this up while we are here.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

+12 -5
+1 -4
arch/arm/boot/compressed/decompress.c
··· 6 6 #include <linux/stddef.h> /* for NULL */ 7 7 #include <linux/linkage.h> 8 8 #include <asm/string.h> 9 - 10 - extern unsigned long free_mem_ptr; 11 - extern unsigned long free_mem_end_ptr; 12 - extern void error(char *); 9 + #include "misc.h" 13 10 14 11 #define STATIC static 15 12 #define STATIC_RW_DATA /* non-static please */
+1 -1
arch/arm/boot/compressed/misc.c
··· 22 22 #include <linux/compiler.h> /* for inline */ 23 23 #include <linux/types.h> 24 24 #include <linux/linkage.h> 25 + #include "misc.h" 25 26 26 27 static void putstr(const char *ptr); 27 - extern void error(char *x); 28 28 29 29 #include CONFIG_UNCOMPRESS_INCLUDE 30 30
+10
arch/arm/boot/compressed/misc.h
··· 1 + #ifndef MISC_H 2 + #define MISC_H 3 + 4 + #include <linux/compiler.h> 5 + 6 + void error(char *x) __noreturn; 7 + extern unsigned long free_mem_ptr; 8 + extern unsigned long free_mem_end_ptr; 9 + 10 + #endif