Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 740504c6 authored by Andy Whitcroft's avatar Andy Whitcroft Committed by Linus Torvalds
Browse files

checkpatch: suspect indent handle macro continuation



When ignoring a macro in the middle of a conditional, we need to ignore
the macro start and any continuation lines.

Signed-off-by: default avatarAndy Whitcroft <apw@shadowen.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bb44ad39
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1465,6 +1465,7 @@ sub process {
			}

			my $cond_ptr = -1;
			$continuation = 0;
			while ($cond_ptr != $cond_lines) {
				$cond_ptr = $cond_lines;

@@ -1478,9 +1479,11 @@ sub process {
				#  1) blank lines, they should be at 0,
				#  2) preprocessor lines, and
				#  3) labels.
				if ($s =~ /^\s*?\n/ ||
				if ($continuation ||
				    $s =~ /^\s*?\n/ ||
				    $s =~ /^\s*#\s*?/ ||
				    $s =~ /^\s*$Ident\s*:/) {
					$continuation = ($s =~ /^.*?\\\n/) ? 1 : 0;
					$s =~ s/^.*?\n//;
					$cond_lines++;
				}