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

Commit 5023d347 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

checkpatch: warn on unnecessary line continuations



When the previous line is not a line continuation and the current line has
a line continuation but is not a #define, emit a warning.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: Andy Whitcroft <apw@canonical.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0ad50c38
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -3013,6 +3013,15 @@ sub process {
					      "Macros with complex values should be enclosed in parenthesis\n" . "$herectx");
				}
			}

# check for line continuations outside of #defines

		} else {
			if ($prevline !~ /^..*\\$/ &&
			    $line =~ /^\+.*\\$/) {
				WARN("LINE_CONTINUATIONS",
				     "Avoid unnecessary line continuations\n" . $herecurr);
			}
		}

# do {} while (0) macro tests: