From: Michal Nazarewicz <mina86@tlen.pl>
To: Rajat Jain <rajat.noida.india@gmail.com>
Cc: Linux Newbies <kernelnewbies@nl.linux.org>,
newbie <linux-newbie@vger.kernel.org>
Subject: Re: strange code in linux kernel
Date: Wed, 07 Oct 2009 20:44:44 +0200 [thread overview]
Message-ID: <87pr8zm4bn.fsf@erwin.mina86.com> (raw)
In-Reply-To: <b115cb5f0910052034h5194a5t113a1bbcd9c878e3@mail.gmail.com> (Rajat Jain's message of "Tue, 6 Oct 2009 09:04:00 +0530")
[-- Attachment #1: Type: text/plain, Size: 1116 bytes --]
Rajat Jain <rajat.noida.india@gmail.com> writes:
> I found that there are some weird looking instances in kernel where a
> function has been DEFINED (as opposite to DECLARED) using and "extern"
> keyword. For e.g., the following code in arch/alpha/include/asm/io.h:
>
> extern inline void __iomem *generic_ioportmap(unsigned long a)
> {
> return alpha_mv.mv_ioportmap(a);
> }
>
> Using a definition along with extern does not make any sense to me.
> Can some one please enlighten what is its use / purpose?
Note that at the same time an "inline" keyword has been used. You might
want to refer to GCC's documentation in particular
<http://gcc.gnu.org/onlinedocs/gcc/Inline.html> for more information.
Google also pointed to this site
<http://www.greenend.org.uk/rjk/2003/03/inline.html> which also might
have some insight.
--
Best regards, _ _
.o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +--<mina86*tlen.pl>--<jid:mina86*jabber.org>--ooO--(_)--Ooo--
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
prev parent reply other threads:[~2009-10-07 18:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-06 3:34 strange code in linux kernel Rajat Jain
2009-10-07 18:44 ` Michal Nazarewicz [this message]
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=87pr8zm4bn.fsf@erwin.mina86.com \
--to=mina86@tlen.pl \
--cc=kernelnewbies@nl.linux.org \
--cc=linux-newbie@vger.kernel.org \
--cc=rajat.noida.india@gmail.com \
/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