Skip to content

Commit 5f8d561

Browse files
author
Russell King
committed
ARM: decompressor: fix warning introduced in fortify patch
Commit ee33355 ("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 <[email protected]>
1 parent 8aeaf4a commit 5f8d561

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

arch/arm/boot/compressed/decompress.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
#include <linux/stddef.h> /* for NULL */
77
#include <linux/linkage.h>
88
#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"
1310

1411
#define STATIC static
1512
#define STATIC_RW_DATA /* non-static please */

arch/arm/boot/compressed/misc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ unsigned int __machine_arch_type;
2222
#include <linux/compiler.h> /* for inline */
2323
#include <linux/types.h>
2424
#include <linux/linkage.h>
25+
#include "misc.h"
2526

2627
static void putstr(const char *ptr);
27-
extern void error(char *x);
2828

2929
#include CONFIG_UNCOMPRESS_INCLUDE
3030

arch/arm/boot/compressed/misc.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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

0 commit comments

Comments
 (0)