lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140509153748.e2467ab487404f07e818719e@freescale.com>
Date:	Fri, 9 May 2014 15:37:48 -0500
From:	Kim Phillips <kim.phillips@...escale.com>
To:	Joe Perches <joe@...ches.com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	<linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
	Andy Whitcroft <apw@...onical.com>
Subject: Re: [PATCH] checkpatch: Make --strict a default for files in
 drivers/net and net/

On Wed, 7 May 2014 11:13:26 -0700
Joe Perches <joe@...ches.com> wrote:

> Networking files are generally more strictly conformant to
> linux-kernel style

checkpatch disagrees :) :

{drivers/}net/ :            ~10.8 CHECKs per .[hc] file
everything else:            ~10   CHECKs per .[hc] file
no net, no drivers/staging:  ~8.6 CHECKs per .[hc] file

(see [1] below for details).

> +		if ($found_file) {
> +			if ($realfile =~ m@^(drivers/net/|net/)@) {

this isn't easily extensible/scalable to other subsystems, or
say something like "all Freescale drivers."  Having it configurable
in .checkpatch.conf might be a better solution, but I don't believe
networking should be the only subsystem that can take advantage of
the extra checkpatch CHECKs.

Can we enable --strict universally in the Linux kernel, maybe like
so:?

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 34eb216..60e1a39 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -228,6 +228,7 @@ if ($tree) {
                print "Must be run from the top-level dir. of a kernel tree\n";
                exit(2);
        }
+       $check = 1;
 }
 
 my $emitted_corrupt = 0;

fwiw, --strict has been set unconditionally in u-boot's
.checkpatch.conf for over a year now, and has significantly reduced
patch revision churn for simple mistakes like parenthesis alignment,
spaces after a cast and/or before a semicolon...

Thanks,

Kim

[1] the following were run on kernel v3.15-rc4-260-g38583f0:

for i in `git ls-files | grep -v '^net/' | grep -v '^drivers/net/' | grep \\\.[ch]$`; do scripts/checkpatch.pl --strict -f $i; done | grep ^CHECK: | wc -l
328329
git ls-files | grep -v '^net/' | grep -v '^drivers/net/' | grep \\\.[ch]$ | wc -l
32754
=> 32754 / 328329 ~= 10 CHECKs per file.[ch] for everything outside of {drivers/}net/.

for i in `git ls-files net/ drivers/net/ | grep \\\.[ch]$`; do scripts/checkpatch.pl --strict -f $i; done | grep ^CHECK: | wc -l
40431
git ls-files net/ drivers/net/ | grep \\\.[ch]$ | wc -l
3742
=> {drivers/}net/: 40431 / 3742 = 10.8 CHECKs per file.[hc]

for i in `git ls-files | grep -v '^net/' | grep -v '^drivers/net/' | grep -v '^drivers/staging/' | grep \\\.[ch]$`; do scripts/checkpatch.pl --strict -f $i; done | grep ^CHECK: | wc -l
262005
git ls-files | grep -v '^net/' | grep -v '^drivers/net/' | grep -v '^drivers/staging/' | grep \\\.[ch]$ | wc -l
30479
=> no net, no staging:  262005 / 30479  =  8.6 CHECKs per file.[hc]
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ