History

Merge branch 'x86/urgent' into x86/pat

Ingo Molnar committed 17 years ago

Commit 55f2b782 parents f5c1aa1 92b9af9143 files · +1733 −994Browse files

Showing the changes to scripts (1 of 143 files). Show all

Unified · Split

scripts/checkpatch.pl+14−12
@@ -10,7 +10,7 @@ use strict; · 9 unmodified lines
1010 my $P = $0;
1111 $P =~ s@.*/@@g;
1212
13−my $V = '0.27';
13+my $V = '0.28';
1414
1515 use Getopt::Long qw(:config no_auto_abbrev);
1616
@@ -110,7 +110,8 @@ our $Sparse = qr{ · 93 unmodified lines
110110 __iomem|
111111 __must_check|
112112 __init_refok|
113− __kprobes
113+ __kprobes|
114+ __ref
114115 }x;
115116 our $Attribute = qr{
116117 const|
@@ -1240,7 +1241,8 @@ sub process { · 1123 unmodified lines
12401241 $realfile =~ s@^([^/]*)/@@;
12411242
12421243 $p1_prefix = $1;
1243− if ($tree && $p1_prefix ne '' && -e "$root/$p1_prefix") {
1244+ if (!$file && $tree && $p1_prefix ne '' &&
1245+ -e "$root/$p1_prefix") {
12441246 WARN("patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n");
12451247 }
12461248
@@ -1583,9 +1585,9 @@ sub process { · 336 unmodified lines
15831585 }
15841586 # TEST: allow direct testing of the attribute matcher.
15851587 if ($dbg_attr) {
1586− if ($line =~ /^.\s*$Attribute\s*$/) {
1588+ if ($line =~ /^.\s*$Modifier\s*$/) {
15871589 ERROR("TEST: is attr\n" . $herecurr);
1588− } elsif ($dbg_attr > 1 && $line =~ /^.+($Attribute)/) {
1590+ } elsif ($dbg_attr > 1 && $line =~ /^.+($Modifier)/) {
15891591 ERROR("TEST: is not attr ($1 is)\n". $herecurr);
15901592 }
15911593 next;
@@ -1657,7 +1659,7 @@ sub process { · 65 unmodified lines
16571659
16581660 # * goes on variable not on type
16591661 # (char*[ const])
1660− if ($line =~ m{\($NonptrType(\s*\*[\s\*]*(?:$Modifier\s*)*)\)}) {
1662+ if ($line =~ m{\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\)}) {
16611663 my ($from, $to) = ($1, $1);
16621664
16631665 # Should start with a space.
@@ -1672,7 +1674,7 @@ sub process { · 8 unmodified lines
16721674 if ($from ne $to) {
16731675 ERROR("\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr);
16741676 }
1675− } elsif ($line =~ m{\b$NonptrType(\s*\*[\s\*]*(?:$Modifier\s*)?)($Ident)}) {
1677+ } elsif ($line =~ m{\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident)}) {
16761678 my ($from, $to, $ident) = ($1, $1, $2);
16771679
16781680 # Should start with a space.
@@ -1685,8 +1687,8 @@ sub process { · 6 unmodified lines
16851687 # Modifiers should have spaces.
16861688 $to =~ s/(\b$Modifier$)/$1 /;
16871689
1688− #print "from<$from> to<$to>\n";
1689− if ($from ne $to) {
1690+ #print "from<$from> to<$to> ident<$ident>\n";
1691+ if ($from ne $to && $ident !~ /^$Modifier$/) {
16901692 ERROR("\"foo${from}bar\" should be \"foo${to}bar\"\n" . $herecurr);
16911693 }
16921694 }
@@ -1885,11 +1887,11 @@ sub process { · 192 unmodified lines
18851887 if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) {
18861888 ERROR("space required before that '$op' $at\n" . $hereptr);
18871889 }
1888− if ($op eq '*' && $cc =~/\s*const\b/) {
1890+ if ($op eq '*' && $cc =~/\s*$Modifier\b/) {
18891891 # A unary '*' may be const
18901892
18911893 } elsif ($ctx =~ /.xW/) {
1892− ERROR("space prohibited after that '$op' $at\n" . $hereptr);
1894+ ERROR("Aspace prohibited after that '$op' $at\n" . $hereptr);
18931895 }
18941896
18951897 # unary ++ and unary -- are allowed no space on one side.
@@ -2560,7 +2562,7 @@ sub process { · 664 unmodified lines
25602562 if ($line =~ /\bin_atomic\s*\(/) {
25612563 if ($realfile =~ m@^drivers/@) {
25622564 ERROR("do not use in_atomic in drivers\n" . $herecurr);
2563− } else {
2565+ } elsif ($realfile !~ m@^kernel/@) {
25642566 WARN("use of in_atomic() is incorrect outside core kernel code\n" . $herecurr);
25652567 }
25662568 }