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: Joe Perches <joe@perches.com>
Reported-by: Madalin-Cristian Bucur <madalin.bucur@freescale.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Joe Perches 2015-04-16 12:44:30 -07:00 коммит произвёл Linus Torvalds
Родитель 2a076f40d8
Коммит 29a3c46673
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -2513,8 +2513,9 @@ sub process {
#line length limit #line length limit
if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ && if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
$rawline !~ /^.\s*\*\s*\@$Ident\s/ && $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&
!($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(KERN_\S+\s*|[^"]*))?"[X\t]*"\s*(?:|,|\)\s*;)\s*$/ || !($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(KERN_\S+\s*|[^"]*))?$String\s*(?:|,|\)\s*;)\s*$/ ||
$line =~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) && $line =~ /^\+\s*$String\s*(?:\s*|,|\)\s*;)\s*$/ ||
$line =~ /^\+\s*#\s*define\s+\w+\s+$String$/) &&
$length > $max_line_length) $length > $max_line_length)
{ {
WARN("LONG_LINE", WARN("LONG_LINE",