浏览代码

checkpatch: macro complexity checks are meaningless in linker scripts

Exclude vmlinux.lds.h from the macro complexity checks.  They will never
apply sanely here.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Andy Whitcroft 17 年之前
父节点
当前提交
b8f96a31f3
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      scripts/checkpatch.pl

+ 2 - 1
scripts/checkpatch.pl

@@ -1860,7 +1860,8 @@ sub process {
 # multi-statement macros should be enclosed in a do while loop, grab the
 # multi-statement macros should be enclosed in a do while loop, grab the
 # first statement and ensure its the whole macro if its not enclosed
 # first statement and ensure its the whole macro if its not enclosed
 # in a known good container
 # in a known good container
-		if ($line =~ /^.\s*\#\s*define\s*$Ident(\()?/) {
+		if ($realfile !~ m@/vmlinux.lds.h$@ &&
+		    $line =~ /^.\s*\#\s*define\s*$Ident(\()?/) {
 			my $ln = $linenr;
 			my $ln = $linenr;
 			my $cnt = $realcnt;
 			my $cnt = $realcnt;
 			my ($off, $dstat, $dcond, $rest);
 			my ($off, $dstat, $dcond, $rest);