All of lore.kernel.org
 help / color / mirror / Atom feed
From: ddaney.cavm@gmail.com (David Daney)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: LLVMLinux: Change "extern inline" to "gnu_inline" in ARM ftrace.h
Date: Wed, 14 Aug 2013 14:51:32 -0700	[thread overview]
Message-ID: <520BFBE4.4040807@gmail.com> (raw)
In-Reply-To: <1376516261-2071-2-git-send-email-behanw@converseincode.com>

On 08/14/2013 02:37 PM, behanw at converseincode.com wrote:
> From: Mark Charlebois <charlebm@gmail.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 the gnu_inline
> attribute makes inline do the right thing on gcc and on clang.
>
> Signed-off-by: Mark Charlebois <charlebm@gmail.com>
> Signed-off-by: Behan Webster <behanw@converseincode.com>
> ---
>   arch/arm/include/asm/ftrace.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
> index f89515a..fb7fdc4 100644
> --- a/arch/arm/include/asm/ftrace.h
> +++ b/arch/arm/include/asm/ftrace.h
> @@ -45,7 +45,8 @@ void *return_address(unsigned int);
>
>   #else
>
> -extern inline void *return_address(unsigned int level)
> +extern inline __attribute__((gnu_inline))

That seems very ugly.

Is it possible to put something in linux/compiler.h that encapsulates 
the desired semantics, and then use that instead?

We already define "inline" that way, if you need something else, put it 
in compiler.h with a nice symbolic name, and then use it.


> +void *return_address(unsigned int level)
>   {
>   	return NULL;
>   }
>

WARNING: multiple messages have this Message-ID (diff)
From: David Daney <ddaney.cavm@gmail.com>
To: behanw@converseincode.com
Cc: linux@arm.linux.org.uk, rostedt@goodmis.org, fweisbec@gmail.com,
	mingo@redhat.com, charlebm@gmail.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: LLVMLinux: Change "extern inline" to "gnu_inline" in ARM ftrace.h
Date: Wed, 14 Aug 2013 14:51:32 -0700	[thread overview]
Message-ID: <520BFBE4.4040807@gmail.com> (raw)
In-Reply-To: <1376516261-2071-2-git-send-email-behanw@converseincode.com>

On 08/14/2013 02:37 PM, behanw@converseincode.com wrote:
> From: Mark Charlebois <charlebm@gmail.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 the gnu_inline
> attribute makes inline do the right thing on gcc and on clang.
>
> Signed-off-by: Mark Charlebois <charlebm@gmail.com>
> Signed-off-by: Behan Webster <behanw@converseincode.com>
> ---
>   arch/arm/include/asm/ftrace.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
> index f89515a..fb7fdc4 100644
> --- a/arch/arm/include/asm/ftrace.h
> +++ b/arch/arm/include/asm/ftrace.h
> @@ -45,7 +45,8 @@ void *return_address(unsigned int);
>
>   #else
>
> -extern inline void *return_address(unsigned int level)
> +extern inline __attribute__((gnu_inline))

That seems very ugly.

Is it possible to put something in linux/compiler.h that encapsulates 
the desired semantics, and then use that instead?

We already define "inline" that way, if you need something else, put it 
in compiler.h with a nice symbolic name, and then use it.


> +void *return_address(unsigned int level)
>   {
>   	return NULL;
>   }
>


  reply	other threads:[~2013-08-14 21:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-14 21:37 [PATCH] Fix extern inline in ftrace.h for ARM behanw at converseincode.com
2013-08-14 21:37 ` behanw
2013-08-14 21:37 ` [PATCH] ARM: LLVMLinux: Change "extern inline" to "gnu_inline" in ARM ftrace.h behanw at converseincode.com
2013-08-14 21:37   ` behanw
2013-08-14 21:51   ` David Daney [this message]
2013-08-14 21:51     ` David Daney
2013-08-14 21:56   ` Joe Perches
2013-08-14 21:56     ` Joe Perches
2013-08-14 22:15     ` Stephen Boyd
2013-08-14 22:15       ` Stephen Boyd
2013-08-14 22:45   ` Russell King - ARM Linux
2013-08-14 22:45     ` Russell King - ARM Linux
2013-09-06  1:10     ` Behan Webster
2013-09-06  1:10       ` Behan Webster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=520BFBE4.4040807@gmail.com \
    --to=ddaney.cavm@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.