diff mbox

arm: LLVMLinux: use static inline in ARM ftrace.h

Message ID 1392949370-26422-1-git-send-email-behanw@converseincode.com (mailing list archive)
State New, archived
Headers show

Commit Message

Behan Webster Feb. 21, 2014, 2:22 a.m. UTC
From: Behan Webster <behanw@converseincode.com>

With compilers which follow the C99 standard (like modern versions of gcc and
clang), "extern inline" does the wrong thing (emits code for an externally
linkable version of the inline function). In this case using static inline
and removing the NULL version of return_address in return_address.c does
the right thing.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
---
 arch/arm/include/asm/ftrace.h    | 2 +-
 arch/arm/kernel/return_address.c | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)

Comments

Behan Webster March 11, 2014, 7:01 a.m. UTC | #1
On 02/20/14 18:22, behanw@converseincode.com wrote:
> From: Behan Webster <behanw@converseincode.com>
>
> With compilers which follow the C99 standard (like modern versions of gcc and
> clang), "extern inline" does the wrong thing (emits code for an externally
> linkable version of the inline function). In this case using static inline
> and removing the NULL version of return_address in return_address.c does
> the right thing.
Any input? Is it good as it is?

Behan
Steven Rostedt March 11, 2014, 12:31 p.m. UTC | #2
On Tue, 11 Mar 2014 00:01:44 -0700
Behan Webster <behanw@converseincode.com> wrote:

> On 02/20/14 18:22, behanw@converseincode.com wrote:
> > From: Behan Webster <behanw@converseincode.com>
> >
> > With compilers which follow the C99 standard (like modern versions of gcc and
> > clang), "extern inline" does the wrong thing (emits code for an externally
> > linkable version of the inline function). In this case using static inline
> > and removing the NULL version of return_address in return_address.c does
> > the right thing.
> Any input? Is it good as it is?

I'm fine with it. But you need approval from the arm folks. I know
there was some issues with the return_address() code in the past. But
from the ftrace perspective:

Acked-by: Steven Rostedt <rostedt@goodmis.org>

-- Steve
diff mbox

Patch

diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
index f89515a..2bb8cac 100644
--- a/arch/arm/include/asm/ftrace.h
+++ b/arch/arm/include/asm/ftrace.h
@@ -45,7 +45,7 @@  void *return_address(unsigned int);
 
 #else
 
-extern inline void *return_address(unsigned int level)
+static inline void *return_address(unsigned int level)
 {
 	return NULL;
 }
diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c
index fafedd8..f6aa84d 100644
--- a/arch/arm/kernel/return_address.c
+++ b/arch/arm/kernel/return_address.c
@@ -63,11 +63,6 @@  void *return_address(unsigned int level)
 #warning "TODO: return_address should use unwind tables"
 #endif
 
-void *return_address(unsigned int level)
-{
-	return NULL;
-}
-
 #endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) / else */
 
 EXPORT_SYMBOL_GPL(return_address);