public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@shadowen.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: Andrew Morton <akpm@osdl.org>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Joel Schopp <jschopp@austin.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] add a trivial patch style checker
Date: Tue, 29 May 2007 10:05:16 +0100	[thread overview]
Message-ID: <465BECCC.5030001@shadowen.org> (raw)
In-Reply-To: <p738xb8fjv2.fsf@bingen.suse.de>

Andi Kleen wrote:
> Andy Whitcroft <apw@shadowen.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.

Thats not an unreasonable position.  And I tend to agree with it.
Either we try and have two levels Warnings and Errors, or we just drop
this one for now.

Anyone got an oppinion, so we can get a consensus.

>> +#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

Yes, changed to labels

>> +		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.

Yep, we also now allow one space something to do with diff -p not
getting confused...

>> +# 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.

Yeah, that is a very sensible idea.

> 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

Thanks.

-apw

  reply	other threads:[~2007-05-29  9:05 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-27 17:11 [PATCH] add a trivial patch style checker Andy Whitcroft
2007-05-27 17:10 ` Randy Dunlap
2007-05-28 10:48   ` Andy Whitcroft
2007-05-29 15:00   ` Joel Schopp
2007-05-27 17:49 ` Andreas Schwab
2007-05-27 21:49 ` Dave Jones
2007-05-28  0:18 ` Andrew Morton
2007-05-28 12:10   ` Andy Whitcroft
2007-05-28  9:13 ` Sam Ravnborg
2007-05-28  9:45 ` Jan Engelhardt
2007-05-29  9:01   ` Andy Whitcroft
2007-05-29 16:12     ` Joel Schopp
2007-05-29 16:20       ` Julio M. Merino Vidal
2007-05-29 20:00     ` Jan Engelhardt
2007-05-29  1:51 ` Qi Yong
2007-05-29  2:23 ` Andi Kleen
2007-05-29  9:05   ` Andy Whitcroft [this message]
2007-05-29 20:22     ` Jan Engelhardt
2007-05-29 22:36       ` Randy Dunlap
2007-05-30  8:34         ` Jan Engelhardt
2007-05-30 15:33           ` Randy Dunlap
2007-05-30 16:04             ` Jan Engelhardt
2007-05-31 12:07     ` [PATCH] add a trivial patch style checker II Andi Kleen
2007-05-31 19:59       ` Dave Jones
2007-06-01 14:18         ` Andy Whitcroft
2007-05-29 11:53   ` [PATCH] add a trivial patch style checker Heiko Carstens
2007-05-29 13:19     ` Andi Kleen
2007-05-29 14:22       ` Heiko Carstens
2007-05-29 14:58         ` Andi Kleen
2007-05-29 16:43           ` Heiko Carstens
2007-05-29 23:21             ` Andi Kleen
2007-05-29 18:55   ` Andy Whitcroft
2007-05-29 21:07 ` [PATCH] add a trivial patch style checker v2 Andy Whitcroft
2007-05-29 22:42   ` Joel Schopp
2007-06-06 12:40   ` Geert Uytterhoeven
2007-06-06 15:04     ` Dave Jones
2007-06-06 18:35     ` Andy Whitcroft
2007-05-31 19:26 ` [PATCH] add a trivial patch style checker Jan Engelhardt

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=465BECCC.5030001@shadowen.org \
    --to=apw@shadowen.org \
    --cc=akpm@osdl.org \
    --cc=andi@firstfloor.org \
    --cc=jschopp@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    /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