浏览代码

checkpatch: quiet Kconfig help message checking

Editing Kconfig dependencies can emit unnecessary messages about missing
or too short help entries.

Only emit the message when adding help sections to Kconfig files.

Signed-off-by: Joe Perches <joe@perches.com>
Reported-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Joe Perches 11 年之前
父节点
当前提交
8d73e0e7dc
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      scripts/checkpatch.pl

+ 4 - 3
scripts/checkpatch.pl

@@ -2052,7 +2052,7 @@ sub process {
 # Only applies when adding the entry originally, after that we do not have
 # Only applies when adding the entry originally, after that we do not have
 # sufficient context to determine whether it is indeed long enough.
 # sufficient context to determine whether it is indeed long enough.
 		if ($realfile =~ /Kconfig/ &&
 		if ($realfile =~ /Kconfig/ &&
-		    $line =~ /.\s*config\s+/) {
+		    $line =~ /^\+\s*config\s+/) {
 			my $length = 0;
 			my $length = 0;
 			my $cnt = $realcnt;
 			my $cnt = $realcnt;
 			my $ln = $linenr + 1;
 			my $ln = $linenr + 1;
@@ -2065,10 +2065,11 @@ sub process {
 				$is_end = $lines[$ln - 1] =~ /^\+/;
 				$is_end = $lines[$ln - 1] =~ /^\+/;
 
 
 				next if ($f =~ /^-/);
 				next if ($f =~ /^-/);
+				last if (!$file && $f =~ /^\@\@/);
 
 
-				if ($lines[$ln - 1] =~ /.\s*(?:bool|tristate)\s*\"/) {
+				if ($lines[$ln - 1] =~ /^\+\s*(?:bool|tristate)\s*\"/) {
 					$is_start = 1;
 					$is_start = 1;
-				} elsif ($lines[$ln - 1] =~ /.\s*(?:---)?help(?:---)?$/) {
+				} elsif ($lines[$ln - 1] =~ /^\+\s*(?:---)?help(?:---)?$/) {
 					$length = -1;
 					$length = -1;
 				}
 				}