aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl17
1 files changed, 8 insertions, 9 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 65bb50076632..33740404cd9e 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2213,8 +2213,7 @@ sub process {
2213 } 2213 }
2214 #next; 2214 #next;
2215 } 2215 }
2216 if ($rawline=~/^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@(.*)/) { 2216 if ($rawline =~ /^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) {
2217 my $context = $4;
2218 $realline=$1-1; 2217 $realline=$1-1;
2219 if (defined $2) { 2218 if (defined $2) {
2220 $realcnt=$3+1; 2219 $realcnt=$3+1;
@@ -2223,12 +2222,6 @@ sub process {
2223 } 2222 }
2224 $in_comment = 0; 2223 $in_comment = 0;
2225 2224
2226 if ($context =~ /\b(\w+)\s*\(/) {
2227 $context_function = $1;
2228 } else {
2229 undef $context_function;
2230 }
2231
2232 # Guestimate if this is a continuing comment. Run 2225 # Guestimate if this is a continuing comment. Run
2233 # the context looking for a comment "edge". If this 2226 # the context looking for a comment "edge". If this
2234 # edge is a close comment then we must be in a comment 2227 # edge is a close comment then we must be in a comment
@@ -2299,7 +2292,8 @@ sub process {
2299 2292
2300#extract the line range in the file after the patch is applied 2293#extract the line range in the file after the patch is applied
2301 if (!$in_commit_log && 2294 if (!$in_commit_log &&
2302 $line =~ /^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) { 2295 $line =~ /^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@(.*)/) {
2296 my $context = $4;
2303 $is_patch = 1; 2297 $is_patch = 1;
2304 $first_line = $linenr + 1; 2298 $first_line = $linenr + 1;
2305 $realline=$1-1; 2299 $realline=$1-1;
@@ -2315,6 +2309,11 @@ sub process {
2315 %suppress_whiletrailers = (); 2309 %suppress_whiletrailers = ();
2316 %suppress_export = (); 2310 %suppress_export = ();
2317 $suppress_statement = 0; 2311 $suppress_statement = 0;
2312 if ($context =~ /\b(\w+)\s*\(/) {
2313 $context_function = $1;
2314 } else {
2315 undef $context_function;
2316 }
2318 next; 2317 next;
2319 2318
2320# track the line number as we move through the hunk, note that 2319# track the line number as we move through the hunk, note that