Skip to content

Commit fb033c9

Browse files
Ben DooksRussell King
authored andcommitted
ARM: 8918/2: only build return_address() if needed
The system currently warns if the config conditions for building return_address in arch/arm/kernel/return_address.c are not met, leaving just an EXPORT_SYMBOL_GPL(return_address) of a function defined to be 'static linline'. This is a result of aeea359 ("ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h"). Since we're not going to build anything other than an exported symbol for something that is already being defined to be an inline-able return of NULL, just avoid building the code to remove the following warning: Fixes: aeea359 ("ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h") Signed-off-by: Ben Dooks <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent cb73737 commit fb033c9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

arch/arm/kernel/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ CFLAGS_REMOVE_return_address.o = -pg
1717
# Object file lists.
1818

1919
obj-y := elf.o entry-common.o irq.o opcodes.o \
20-
process.o ptrace.o reboot.o return_address.o \
20+
process.o ptrace.o reboot.o \
2121
setup.o signal.o sigreturn_codes.o \
2222
stacktrace.o sys_arm.o time.o traps.o
2323

24+
ifneq ($(CONFIG_ARM_UNWIND),y)
25+
obj-$(CONFIG_FRAME_POINTER) += return_address.o
26+
endif
27+
2428
obj-$(CONFIG_ATAGS) += atags_parse.o
2529
obj-$(CONFIG_ATAGS_PROC) += atags_proc.o
2630
obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o

arch/arm/kernel/return_address.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
*/
88
#include <linux/export.h>
99
#include <linux/ftrace.h>
10-
11-
#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND)
1210
#include <linux/sched.h>
1311

1412
#include <asm/stacktrace.h>
@@ -53,6 +51,4 @@ void *return_address(unsigned int level)
5351
return NULL;
5452
}
5553

56-
#endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) */
57-
5854
EXPORT_SYMBOL_GPL(return_address);

0 commit comments

Comments
 (0)