aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f2bbea900700..bd88f11b0953 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1382,6 +1382,21 @@ sub process {
1382 ERROR("trailing whitespace\n" . $herevet); 1382 ERROR("trailing whitespace\n" . $herevet);
1383 } 1383 }
1384 1384
1385# check for Kconfig help text having a real description
1386 if ($realfile =~ /Kconfig/ &&
1387 $line =~ /\+?\s*(---)?help(---)?$/) {
1388 my $length = 0;
1389 for (my $l = $linenr; defined($lines[$l]); $l++) {
1390 my $f = $lines[$l];
1391 $f =~ s/#.*//;
1392 $f =~ s/^\s+//;
1393 next if ($f =~ /^$/);
1394 last if ($f =~ /^\s*config\s/);
1395 $length++;
1396 }
1397 WARN("please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($length < 4);
1398 }
1399
1385# check we are in a valid source file if not then ignore this hunk 1400# check we are in a valid source file if not then ignore this hunk
1386 next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/); 1401 next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/);
1387 1402
@@ -2586,6 +2601,11 @@ sub process {
2586 CHK("architecture specific defines should be avoided\n" . $herecurr); 2601 CHK("architecture specific defines should be avoided\n" . $herecurr);
2587 } 2602 }
2588 2603
2604# Check that the storage class is at the beginning of a declaration
2605 if ($line =~ /\b$Storage\b/ && $line !~ /^.\s*$Storage\b/) {
2606 WARN("storage class should be at the beginning of the declaration\n" . $herecurr)
2607 }
2608
2589# check the location of the inline attribute, that it is between 2609# check the location of the inline attribute, that it is between
2590# storage class and type. 2610# storage class and type.
2591 if ($line =~ /\b$Type\s+$Inline\b/ || 2611 if ($line =~ /\b$Type\s+$Inline\b/ ||