public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] include/asm-mips/processor.h: "extern inline" -> "static inline"
@ 2007-07-07  1:03 Adrian Bunk
  2007-07-09 10:27 ` Ralf Baechle
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2007-07-07  1:03 UTC (permalink / raw)
  To: ralf; +Cc: linux-mips, linux-kernel

"extern inline" will have different semantics with gcc 4.3,
and "static inline" is correct here.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---
--- linux-2.6.22-rc6-mm1/include/asm-mips/processor.h.old	2007-07-07 01:06:35.000000000 +0200
+++ linux-2.6.22-rc6-mm1/include/asm-mips/processor.h	2007-07-07 01:06:57.000000000 +0200
@@ -237,7 +237,7 @@
 
 #define ARCH_HAS_PREFETCH
 
-extern inline void prefetch(const void *addr)
+static inline void prefetch(const void *addr)
 {
 	__asm__ __volatile__(
 	"	.set	mips4		\n"


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [2.6 patch] include/asm-mips/processor.h: "extern inline" -> "static inline"
  2007-07-07  1:03 [2.6 patch] include/asm-mips/processor.h: "extern inline" -> "static inline" Adrian Bunk
@ 2007-07-09 10:27 ` Ralf Baechle
  2007-07-09 11:40   ` Franck Bui-Huu
  2007-07-09 12:22   ` Adrian Bunk
  0 siblings, 2 replies; 5+ messages in thread
From: Ralf Baechle @ 2007-07-09 10:27 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-mips, linux-kernel

On Sat, Jul 07, 2007 at 03:03:30AM +0200, Adrian Bunk wrote:

> "extern inline" will have different semantics with gcc 4.3,
> and "static inline" is correct here.

The idea was to have a linker error in case gcc should deciede for some
reason not to inline this function which as I understand will continue
to be the behaviour of gcc 4.3?

  Ralf

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [2.6 patch] include/asm-mips/processor.h: "extern inline" -> "static inline"
  2007-07-09 10:27 ` Ralf Baechle
@ 2007-07-09 11:40   ` Franck Bui-Huu
  2007-07-09 12:22   ` Adrian Bunk
  1 sibling, 0 replies; 5+ messages in thread
From: Franck Bui-Huu @ 2007-07-09 11:40 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Adrian Bunk, linux-mips, linux-kernel

Hi,

On 7/9/07, Ralf Baechle <ralf@linux-mips.org> wrote:
> On Sat, Jul 07, 2007 at 03:03:30AM +0200, Adrian Bunk wrote:
>
> > "extern inline" will have different semantics with gcc 4.3,
> > and "static inline" is correct here.
>
> The idea was to have a linker error in case gcc should deciede for some
> reason not to inline this function which as I understand will continue
> to be the behaviour of gcc 4.3?
>

I don't know for this peculiar case but it usually is a good thing to
let gcc decide if the function needs to be inlined or not.

If we really want this function to be inlined in all cases, maybe we
should use __always_inline attribute instead ?

-- 
               Franck

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [2.6 patch] include/asm-mips/processor.h: "extern inline" -> "static inline"
  2007-07-09 10:27 ` Ralf Baechle
  2007-07-09 11:40   ` Franck Bui-Huu
@ 2007-07-09 12:22   ` Adrian Bunk
  2007-07-09 13:06     ` Ralf Baechle
  1 sibling, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2007-07-09 12:22 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, linux-kernel

On Mon, Jul 09, 2007 at 11:27:55AM +0100, Ralf Baechle wrote:
> On Sat, Jul 07, 2007 at 03:03:30AM +0200, Adrian Bunk wrote:
> 
> > "extern inline" will have different semantics with gcc 4.3,
> > and "static inline" is correct here.
> 
> The idea was to have a linker error in case gcc should deciede for some
> reason not to inline this function

If that's the intention, please use __always_inline instead.

> which as I understand will continue
> to be the behaviour of gcc 4.3?

In C99 (and therefore in gcc >= 4.3), "extern inline" means that the 
function should be compiled inline where the inline definition is seen, 
and that the compiler should also emit a copy of the function body with 
an externally visible symbol.

You don't want this.

>   Ralf

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [2.6 patch] include/asm-mips/processor.h: "extern inline" -> "static inline"
  2007-07-09 12:22   ` Adrian Bunk
@ 2007-07-09 13:06     ` Ralf Baechle
  0 siblings, 0 replies; 5+ messages in thread
From: Ralf Baechle @ 2007-07-09 13:06 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: linux-mips, linux-kernel

On Mon, Jul 09, 2007 at 02:22:40PM +0200, Adrian Bunk wrote:

> In C99 (and therefore in gcc >= 4.3), "extern inline" means that the 
> function should be compiled inline where the inline definition is seen, 
> and that the compiler should also emit a copy of the function body with 
> an externally visible symbol.

Uh, indeed.  Thanks for the reminder.  Patch applied.

  Ralf

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-09 13:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-07  1:03 [2.6 patch] include/asm-mips/processor.h: "extern inline" -> "static inline" Adrian Bunk
2007-07-09 10:27 ` Ralf Baechle
2007-07-09 11:40   ` Franck Bui-Huu
2007-07-09 12:22   ` Adrian Bunk
2007-07-09 13:06     ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox