linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Mallon <rmallon@gmail.com>
To: daley <daleydeng@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Two question about kernel global function declaration and directory layout
Date: Tue, 04 Sep 2012 10:59:35 +1000	[thread overview]
Message-ID: <50455277.40109@gmail.com> (raw)
In-Reply-To: <5044CDAB.4000902@gmail.com>

On 04/09/12 01:32, daley wrote:
> hi, everyone, I'm a big fan of the kernel, I was always being attracted
> by its clean and intelligent design. I'm new to the mailing list and
> this is my first post. I want to ask two basic question about kernel
> which bother me a lot, I've googled a lot but nobody could give a
> suitable answer .
> 
> The first one is about global function declaration, I was confused about
> the usage of keyword "extern" before a global function which declared in
> the header file. for example,

It specifies that the function has external linkage, which is the
opposite of internal (static keyword) linkage. The default linkage for
functions in external, so the extern keyword is not technically
required, but many developers like to specify it explicitly. C linkage
is explained here:

  http://publications.gbdirect.co.uk/c_book/chapter4/linkage.html

> The second question is why not move the *sound* directory into the
> *drivers* directory or put bigger subsystem out of drivers, since there
> are more bigger subsystems(e.g. media, scsi) than sound?

This was discussed a couple of years back, but never happened. I'm not
sure what the reasons were. You can read through the discussion yourself
if you are so inclined. There is an email from Linus explaining some of
the historical reasons why the sound code is in sound/ and not
drivers/sound:

  http://lkml.indiana.edu/hypermail/linux/kernel/0805.2/3026.html

~Ryan



      reply	other threads:[~2012-09-04  0:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-03 15:32 Two question about kernel global function declaration and directory layout daley
2012-09-04  0:59 ` Ryan Mallon [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=50455277.40109@gmail.com \
    --to=rmallon@gmail.com \
    --cc=daleydeng@gmail.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;
as well as URLs for NNTP newsgroup(s).