Skip to content

Commit

Permalink
ARM: decompressor: fix warning introduced in fortify patch
Browse files Browse the repository at this point in the history
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 <rmk+kernel@armlinux.org.uk>
  • Loading branch information
Russell King committed Apr 5, 2018
1 parent 8aeaf4a commit 5f8d561
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 1 addition & 4 deletions arch/arm/boot/compressed/decompress.c
Original file line number Diff line number Diff line change
@@ -6,10 +6,7 @@
#include <linux/stddef.h> /* for NULL */
#include <linux/linkage.h>
#include <asm/string.h>

extern unsigned long free_mem_ptr;
extern unsigned long free_mem_end_ptr;
extern void error(char *);
#include "misc.h"

#define STATIC static
#define STATIC_RW_DATA /* non-static please */
2 changes: 1 addition & 1 deletion arch/arm/boot/compressed/misc.c
Original file line number Diff line number Diff line change
@@ -22,9 +22,9 @@ unsigned int __machine_arch_type;
#include <linux/compiler.h> /* for inline */
#include <linux/types.h>
#include <linux/linkage.h>
#include "misc.h"

static void putstr(const char *ptr);
extern void error(char *x);

#include CONFIG_UNCOMPRESS_INCLUDE

10 changes: 10 additions & 0 deletions arch/arm/boot/compressed/misc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef MISC_H
#define MISC_H

#include <linux/compiler.h>

void error(char *x) __noreturn;
extern unsigned long free_mem_ptr;
extern unsigned long free_mem_end_ptr;

#endif

0 comments on commit 5f8d561

Please sign in to comment.