[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.61.0706041812150.20829@yvahk01.tjqt.qr>
Date: Mon, 4 Jun 2007 18:25:37 +0200 (MEST)
From: Jan Engelhardt <jengelh@...ux01.gwdg.de>
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] update checkpatch.pl to version 0.03
On Jun 4 2007 10:46, Andy Whitcroft wrote:
>
> - catch use of volatile
Speaking of volatile, "register" is probably just as unwanted.
Then, "extern inline" is one thing to catch (does not happen
that often, but it does not cost too much either).
> - warn about #ifdef's in c files
Really? There are a lot of ifdefs in existing code, and it is
probably inevitable to add some in newer code ... overall
leading to more false positives and cluttering the output.
Or am I gone wrong somewhere?
>+
>+ } elsif (/^Funcs:\s+(.*\S)/) {
>+ for my $func (split(/[, ]+/, $1)) {
>+ push(@dep_functions, $func);
>+ }
for -> foreach, although it does not functionally change anything.
Yeah, Perl is funny, for(one arg) is actually foreach().
Quite confusing to for(three args).
>+sub line_stats {
^ = \n ?
>+ last if (scalar(@o) == scalar(@c));
Or last if $#o == $#c. Again, personal taste (=do it your way).
I do not think $#a is any cheaper than scalar(@a) anyway.
>+sub has_non_quoted {
>+ return ($_[0] =~ m{$_[1]} and $_[0] !~ m{\".*$_[1].*\"});
>+}
Safe? Or intended? Did you want to allow regexes?
Otherwise...
return $_[0] =~ /\Q$_[1]\E/ && $_[0] !~ /".*\Q$_[1]\E.*"/;
> if (!($line =~ /^\s*Signed-off-by:/)) {
^ ^^
=> if($line !~ /.../)
Gotta love perl. Perhaps one language where you'll always find a
way to circumvent any CodingStyle ever written :p
> #80 column limit
>- if (!($prevline=~/\/\*\*/) && length($lineforcounting) > 80) {
>+ if (!($prevline=~/\/\*\*/) && $length > 80) {
I say thee 79. But we had that more or less already.
>+ for my $ctx (@ctx) {
>- while ($remaining > 0 && scalar @opened > scalar @closed) {
>+ while ($remaining > 1 && scalar @opened > scalar @closed) {
Although scalar might bind as hard as sizeof in C, I suggest parentheses.
(Or $#)
while ($remaining > 1 && scalar(@opened) > scalar(@closed))
>+# warn about #ifdefs in C files
>+ if ($line =~ /^.#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {
save a capture operation: /^.#\s*ifn?def/
Jan
--
-
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