kernel: bump 5.4 to 5.4.119
[openwrt/openwrt.git] / target / linux / generic / backport-5.4 / 040-ARM-8918-2-only-build-return_address-if-needed.patch
1 From fb033c95c94ca1ee3d16e04ebdb85d65fb55fff8 Mon Sep 17 00:00:00 2001
2 From: Ben Dooks <ben-linux@fluff.org>
3 Date: Mon, 4 Nov 2019 18:15:15 +0100
4 Subject: [PATCH] ARM: 8918/2: only build return_address() if needed
5
6 The system currently warns if the config conditions for
7 building return_address in arch/arm/kernel/return_address.c
8 are not met, leaving just an EXPORT_SYMBOL_GPL(return_address)
9 of a function defined to be 'static linline'.
10 This is a result of aeea3592a13b ("ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h").
11
12 Since we're not going to build anything other than an exported
13 symbol for something that is already being defined to be an
14 inline-able return of NULL, just avoid building the code to
15 remove the following warning:
16
17 Fixes: aeea3592a13b ("ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h")
18 Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
19 Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
20 ---
21 arch/arm/kernel/Makefile | 6 +++++-
22 arch/arm/kernel/return_address.c | 4 ----
23 2 files changed, 5 insertions(+), 5 deletions(-)
24
25 --- a/arch/arm/kernel/Makefile
26 +++ b/arch/arm/kernel/Makefile
27 @@ -17,10 +17,14 @@ CFLAGS_REMOVE_return_address.o = -pg
28 # Object file lists.
29
30 obj-y := elf.o entry-common.o irq.o opcodes.o \
31 - process.o ptrace.o reboot.o return_address.o \
32 + process.o ptrace.o reboot.o \
33 setup.o signal.o sigreturn_codes.o \
34 stacktrace.o sys_arm.o time.o traps.o
35
36 +ifneq ($(CONFIG_ARM_UNWIND),y)
37 +obj-$(CONFIG_FRAME_POINTER) += return_address.o
38 +endif
39 +
40 obj-$(CONFIG_ATAGS) += atags_parse.o
41 obj-$(CONFIG_ATAGS_PROC) += atags_proc.o
42 obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o
43 --- a/arch/arm/kernel/return_address.c
44 +++ b/arch/arm/kernel/return_address.c
45 @@ -7,8 +7,6 @@
46 */
47 #include <linux/export.h>
48 #include <linux/ftrace.h>
49 -
50 -#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND)
51 #include <linux/sched.h>
52
53 #include <asm/stacktrace.h>
54 @@ -53,6 +51,4 @@ void *return_address(unsigned int level)
55 return NULL;
56 }
57
58 -#endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) */
59 -
60 EXPORT_SYMBOL_GPL(return_address);