mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: PCI: Remove "extern" from function declarations
Date: Thu, 18 Apr 2013 09:24:44 +1000	[thread overview]
Message-ID: <20130418092444.a4d64d8a9b5f700ba2aae779@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 1099 bytes --]

Hi Bjorn,

I just noticed this commit (f39d5b72913e "PCI: Remove "extern" from
function declarations") in the pci next branch.  Just wondering why you
would do such a thing.  It is a lot of churn in quite a few header files
and (in my opinion) goes the wrong way anyway.

It may not actually make any difference to the compiler for functions, but
for variables, it does.   A variable declared in a header file without
"extern" will effectively define it in every compilation that includes
the header file, one with "extern" will only produce references.

So, since, the global variables really should have the "extern", the
functions are now inconsistent with that.

It also means that when someone copies a function declaration to make a
"static inline" stub, the "extern" is a big hint for them to remember to
make the stub "static" - I have seen several occasions when this was not
done and that causes compilation failures (but usually only in the
configuration that the author did not bother to test).
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

             reply	other threads:[~2013-04-17 23:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-17 23:24 Stephen Rothwell [this message]
2013-04-17 23:57 ` Bjorn Helgaas

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=20130418092444.a4d64d8a9b5f700ba2aae779@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@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

all inboxes | Powered by JetHome®