git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nfsd4: use common rpc_cred for all callbacks
[safe/jmp/linux-2.6]
/
scripts
/
checkpatch.pl
diff --git
a/scripts/checkpatch.pl
b/scripts/checkpatch.pl
index
5ea55e3
..
2d5ece7
100755
(executable)
--- a/
scripts/checkpatch.pl
+++ b/
scripts/checkpatch.pl
@@
-10,7
+10,7
@@
use strict;
my $P = $0;
$P =~ s@.*/@@g;
my $P = $0;
$P =~ s@.*/@@g;
-my $V = '0.2
6
';
+my $V = '0.2
8
';
use Getopt::Long qw(:config no_auto_abbrev);
use Getopt::Long qw(:config no_auto_abbrev);
@@
-110,7
+110,8
@@
our $Sparse = qr{
__iomem|
__must_check|
__init_refok|
__iomem|
__must_check|
__init_refok|
- __kprobes
+ __kprobes|
+ __ref
}x;
our $Attribute = qr{
const|
}x;
our $Attribute = qr{
const|
@@
-1240,7
+1241,8
@@
sub process {
$realfile =~ s@^([^/]*)/@@;
$p1_prefix = $1;
$realfile =~ s@^([^/]*)/@@;
$p1_prefix = $1;
- if ($tree && $p1_prefix ne '' && -e "$root/$p1_prefix") {
+ if (!$file && $tree && $p1_prefix ne '' &&
+ -e "$root/$p1_prefix") {
WARN("patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n");
}
WARN("patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n");
}
@@
-1583,9
+1585,9
@@
sub process {
}
# TEST: allow direct testing of the attribute matcher.
if ($dbg_attr) {
}
# TEST: allow direct testing of the attribute matcher.
if ($dbg_attr) {
- if ($line =~ /^.\s*$
Attribute
\s*$/) {
+ if ($line =~ /^.\s*$
Modifier
\s*$/) {
ERROR("TEST: is attr\n" . $herecurr);
ERROR("TEST: is attr\n" . $herecurr);
- } elsif ($dbg_attr > 1 && $line =~ /^.+($
Attribute
)/) {
+ } elsif ($dbg_attr > 1 && $line =~ /^.+($
Modifier
)/) {
ERROR("TEST: is not attr ($1 is)\n". $herecurr);
}
next;
ERROR("TEST: is not attr ($1 is)\n". $herecurr);
}
next;
@@
-1657,7
+1659,7
@@
sub process {
# * goes on variable not on type
# (char*[ const])
# * goes on variable not on type
# (char*[ const])
- if ($line =~ m{\($NonptrType(\s*
\*[\s\*]*(?:$Modifier\s*)*
)\)}) {
+ if ($line =~ m{\($NonptrType(\s*
(?:$Modifier\b\s*|\*\s*)+
)\)}) {
my ($from, $to) = ($1, $1);
# Should start with a space.
my ($from, $to) = ($1, $1);
# Should start with a space.
@@
-1672,7
+1674,7
@@
sub process {
if ($from ne $to) {
ERROR("\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr);
}
if ($from ne $to) {
ERROR("\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr);
}
- } elsif ($line =~ m{\b$NonptrType(\s*
\*[\s\*]*(?:$Modifier\s*)?
)($Ident)}) {
+ } elsif ($line =~ m{\b$NonptrType(\s*
(?:$Modifier\b\s*|\*\s*)+
)($Ident)}) {
my ($from, $to, $ident) = ($1, $1, $2);
# Should start with a space.
my ($from, $to, $ident) = ($1, $1, $2);
# Should start with a space.
@@
-1685,8
+1687,8
@@
sub process {
# Modifiers should have spaces.
$to =~ s/(\b$Modifier$)/$1 /;
# Modifiers should have spaces.
$to =~ s/(\b$Modifier$)/$1 /;
- #print "from<$from> to<$to>\n";
- if ($from ne $to) {
+ #print "from<$from> to<$to>
ident<$ident>
\n";
+ if ($from ne $to
&& $ident !~ /^$Modifier$/
) {
ERROR("\"foo${from}bar\" should be \"foo${to}bar\"\n" . $herecurr);
}
}
ERROR("\"foo${from}bar\" should be \"foo${to}bar\"\n" . $herecurr);
}
}
@@
-1885,11
+1887,11
@@
sub process {
if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) {
ERROR("space required before that '$op' $at\n" . $hereptr);
}
if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) {
ERROR("space required before that '$op' $at\n" . $hereptr);
}
- if ($op eq '*' && $cc =~/\s*
const
\b/) {
+ if ($op eq '*' && $cc =~/\s*
$Modifier
\b/) {
# A unary '*' may be const
} elsif ($ctx =~ /.xW/) {
# A unary '*' may be const
} elsif ($ctx =~ /.xW/) {
- ERROR("space prohibited after that '$op' $at\n" . $hereptr);
+ ERROR("
A
space prohibited after that '$op' $at\n" . $hereptr);
}
# unary ++ and unary -- are allowed no space on one side.
}
# unary ++ and unary -- are allowed no space on one side.
@@
-2527,9
+2529,10
@@
sub process {
WARN("please use device_initcall() instead of __initcall()\n" . $herecurr);
}
# check for struct file_operations, ensure they are const.
WARN("please use device_initcall() instead of __initcall()\n" . $herecurr);
}
# check for struct file_operations, ensure they are const.
- if ($line =~ /\bstruct\s+file_operations\b/ &&
- $line !~ /\bconst\b/) {
- WARN("struct file_operations should normally be const\n" . $herecurr);
+ if ($line !~ /\bconst\b/ &&
+ $line =~ /\bstruct\s+(file_operations|seq_operations)\b/) {
+ WARN("struct $1 should normally be const\n" .
+ $herecurr);
}
# use of NR_CPUS is usually wrong
}
# use of NR_CPUS is usually wrong
@@
-2559,7
+2562,7
@@
sub process {
if ($line =~ /\bin_atomic\s*\(/) {
if ($realfile =~ m@^drivers/@) {
ERROR("do not use in_atomic in drivers\n" . $herecurr);
if ($line =~ /\bin_atomic\s*\(/) {
if ($realfile =~ m@^drivers/@) {
ERROR("do not use in_atomic in drivers\n" . $herecurr);
- } els
e
{
+ } els
if ($realfile !~ m@^kernel/@)
{
WARN("use of in_atomic() is incorrect outside core kernel code\n" . $herecurr);
}
}
WARN("use of in_atomic() is incorrect outside core kernel code\n" . $herecurr);
}
}