public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Kimball Murray <kmurray@redhat.com>
Cc: Jens Axboe <axboe@suse.de>, linux-kernel@vger.kernel.org
Subject: Re: [2.6 patch] include/linux/bio.h: "extern inline" -> "static inline"
Date: Wed, 27 Jul 2005 18:23:34 +0200	[thread overview]
Message-ID: <20050727162334.GF3160@stusta.de> (raw)
In-Reply-To: <42E7A157.3080508@redhat.com>

On Wed, Jul 27, 2005 at 10:59:35AM -0400, Kimball Murray wrote:
> Jens Axboe wrote:
> 
> >On Tue, Jul 26 2005, Adrian Bunk wrote:
> > 
> >
> >>"extern inline" doesn't make much sense.
> >>   
> >>
> >
> >Yep, thanks.
> >
> > 
> >
> IIRC, there was a time when the extern inline construct was used to 
> catch cases where the compiler did not inline the function (you'd get a 
> link error).  Seems like it still works.  Try building the attached 
> files in each of the following ways:
> 
> gcc -o foo foo.c
> 
>    and
> 
> gcc -O2 -o foo foo.c
> 
> In the first case, you get a link error, because there is no inlining.

In the kernel, we have a
  # define inline         inline          __attribute__((always_inline))

This doesn't leave gcc any choice to not inline the function.

> -kimball

> #include "bar.h"
> 
> void foo(void) {
> 	bar();
> }
> 
> int main(int argc, char *argv[])
> {
> 	foo();
> 	return 0;
> }

> extern inline void bar(void)
> {
> }

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


  reply	other threads:[~2005-07-27 16:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-26 14:53 [2.6 patch] include/linux/bio.h: "extern inline" -> "static inline" Adrian Bunk
2005-07-27  1:49 ` Horst von Brand
2005-07-27 12:05   ` Adrian Bunk
2005-07-27 14:29 ` Jens Axboe
2005-07-27 14:59   ` Kimball Murray
2005-07-27 16:23     ` Adrian Bunk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-07-31 22:26 Adrian Bunk

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=20050727162334.GF3160@stusta.de \
    --to=bunk@stusta.de \
    --cc=axboe@suse.de \
    --cc=kmurray@redhat.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox