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

Commit 29a3c466 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

checkpatch: add #define foo "string" long line exception



There are #defines with long string constants like:
	#define foo "some really long string > 80 columns"
Add a long line exception for them.

Miscellanea:

Use the $String variable for slightly better readability

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Reported-by: default avatarMadalin-Cristian Bucur <madalin.bucur@freescale.com>
Cc: Andy 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 2a076f40
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2513,8 +2513,9 @@ sub process {
#line length limit
		if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
		    $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&
		    !($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(KERN_\S+\s*|[^"]*))?"[X\t]*"\s*(?:|,|\)\s*;)\s*$/ ||
		    $line =~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) &&
		    !($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(KERN_\S+\s*|[^"]*))?$String\s*(?:|,|\)\s*;)\s*$/ ||
		      $line =~ /^\+\s*$String\s*(?:\s*|,|\)\s*;)\s*$/ ||
		      $line =~ /^\+\s*#\s*define\s+\w+\s+$String$/) &&
		    $length > $max_line_length)
		{
			WARN("LONG_LINE",