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: <p738xb8fjv2.fsf@bingen.suse.de>
Date:	29 May 2007 04:23:45 +0200
From:	Andi Kleen <andi@...stfloor.org>
To:	Andy Whitcroft <apw@...dowen.org>
Cc:	Andrew Morton <akpm@...l.org>, Randy Dunlap <rdunlap@...otime.net>,
	Joel Schopp <jschopp@...tin.ibm.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] add a trivial patch style checker

Andy Whitcroft <apw@...dowen.org> writes:
> +
> +# no BUG() or BUG_ON()
> +		if ($line =~ /\b(BUG|BUG_ON)\b/) {
> +			print "Try to use WARN_ON & Recovery code rather than BUG() or BUG_ON()\n";

Just outlawing BUG_ON doesn't seem like a good idea to me. We'll just end
up with lots of untested and likely buggy recovery code or no asserts. Both
would be bad.

> +#need space before brace following if, while, etc
> +		if($line=~/\(.*\){/) {
> +			print ("need a space before the brace\n");
> +			print "$herecurr";
> +			$clean = 0;		
> +		}
> +
> +#gotos aren't indented

You mean goto labels? Surely goto statements are to be indented.
Confusing message

> +		if($line=~/^\s*[A-Za-z\d_]+:/ and !($line=~/^\s*default:/)){
> +			print "Gotos should not be indented\n";
> +			print "$herecurr";
> +			$clean = 0;
> +		}

emacs generates one space label in front of a goto label. I wouldn't
outlaw this.

> +# don't include <linux/video_decoder.h>

It would be probably better to define some syntax that makes it possible
to auto extract those from feature-removal-schedule.txt. Otherwise
long term this will become messy.

Possible further checks that might make sense:
- panic() anywhere in drivers/* 
- externs in .c files without asmlinkage
- general checking that everything in a fully visible {} block is the right 
indentation

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ