From: Ryan Mallon <rmallon@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/12] ping.h: Remove extern from function prototypes
Date: Mon, 23 Sep 2013 12:38:06 +1000 [thread overview]
Message-ID: <523FA98E.4080908@gmail.com> (raw)
In-Reply-To: <1379902599.3575.9.camel@joe-AO722>
On 23/09/13 12:16, Joe Perches wrote:
> On Mon, 2013-09-23 at 11:59 +1000, Ryan Mallon wrote:
>> This seems like a lot of code churn for very little benefit. At a quick
>> glance:
>>
>> git grep extern include/ | wc -l
>> 11427
>>
>> Not all of those will need to be removed, but that is still a huge
>> number to change, and doesn't include extern usage in C files or local
>> headers. You are probably never going to remove all the instances, so
>> what is the point of just randomly doing a handful?
>
> Rather more than a handful.
>
> The ratio of function prototypes without extern to
> function prototypes with extern is currently ~2.5:1
>
> So:
>
> Standardization without extern
> Line count reduction (~10%)
> Miscellaneous neatening at the same time
> Removal of all unnecessary externs from include/net
>
> There are ~8500 instances in include/
> There are ~1500 instances in include/net/
>
> After this series, 0 in include/net/
>
> Start somewhere, go from there...
>
> $ git grep -E "^\s*\bextern(\s+\w+){1,4}\s*\(\s*[^\*]" include/ | wc -l
> 8395
> $ git grep -E "^\s*\bextern(\s+\w+){1,4}\s*\(\s*[^\*]" include/net/ | wc -l
> 1471
Right, and:
$ git grep -E "^\s*\bextern(\s+\w+){1,4}\s*\(\s*[^\*]" | wc -l
29104
Since there are lots of local/arch headers, and there are uses of extern
function prototypes in C files.
I don't see the real benefit though. Its like trying to "clean-up" the
difference between "unsigned x" and "unsigned int x", or any number of
other minor style differences. Either version, with or without the
extern, is correct, valid C code. Plus you will get people adding new
instances of extern because they don't know any better. A checkpatch
rule might help, but we all know how often people run that...
~Ryan
next prev parent reply other threads:[~2013-09-23 2:38 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-22 17:32 [PATCH 01/12] ping.h: Remove extern from function prototypes Joe Perches
2013-09-22 17:32 ` [PATCH 02/12] protocol.h: " Joe Perches
2013-09-22 17:32 ` [PATCH 03/12] psnap.h: " Joe Perches
2013-09-22 17:32 ` [PATCH 04/12] raw/rawv6.h: " Joe Perches
2013-09-22 17:32 ` [PATCH 05/12] request_sock.h: " Joe Perches
2013-09-22 17:32 ` [PATCH 06/12] rose.h: " Joe Perches
2013-09-22 17:32 ` [PATCH 07/12] route.h: " Joe Perches
2013-09-22 17:32 ` [PATCH 08/12] rtnetlink.h: " Joe Perches
2013-09-22 17:32 ` [PATCH 09/12] scm.h: " Joe Perches
2013-09-22 17:32 ` [PATCH 10/12] secure_seq.h: " Joe Perches
2013-09-22 17:32 ` [PATCH 11/12] sock.h: " Joe Perches
2013-09-22 17:32 ` [PATCH 12/12] stp.h: " Joe Perches
2013-09-23 1:59 ` [PATCH 01/12] ping.h: " Ryan Mallon
2013-09-23 2:16 ` Joe Perches
2013-09-23 2:38 ` Ryan Mallon [this message]
2013-09-23 2:43 ` Joe Perches
2013-09-23 5:51 ` David Miller
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=523FA98E.4080908@gmail.com \
--to=rmallon@gmail.com \
--cc=davem@davemloft.net \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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).