aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorcodeworkx <codeworkx@cyanogenmod.com>2012-09-22 09:48:20 +0200
committercodeworkx <codeworkx@cyanogenmod.com>2012-09-22 14:02:16 +0200
commit2489007e7d740ccbc3e0a202914e243ad5178787 (patch)
treeb8e6380ea7b1da63474ad68a5dba997e01146043 /scripts
parent5f67568eb31e3a813c7c52461dcf66ade15fc2e7 (diff)
downloadkernel_samsung_smdk4412-2489007e7d740ccbc3e0a202914e243ad5178787.zip
kernel_samsung_smdk4412-2489007e7d740ccbc3e0a202914e243ad5178787.tar.gz
kernel_samsung_smdk4412-2489007e7d740ccbc3e0a202914e243ad5178787.tar.bz2
merge opensource jb u5
Change-Id: I1aaec157aa196f3448eff8636134fce89a814cf2
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 0b3e35c..9ada45c 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -16,6 +16,7 @@ use Getopt::Long qw(:config no_auto_abbrev);
my $quiet = 0;
my $tree = 1;
+my $chk_subject = 1;
my $chk_signoff = 1;
my $chk_patch = 1;
my $tst_only;
@@ -98,6 +99,7 @@ if (-f $conf) {
GetOptions(
'q|quiet+' => \$quiet,
'tree!' => \$tree,
+ 'subject!' => \$chk_subject,
'signoff!' => \$chk_signoff,
'patch!' => \$chk_patch,
'emacs!' => \$emacs,
@@ -340,6 +342,7 @@ sub deparenthesize {
return $string;
}
+$chk_subject = 0 if ($file);
$chk_signoff = 0 if ($file);
my @dep_includes = ();
@@ -1533,6 +1536,26 @@ sub process {
}
}
+# Check for subject:
+ if ($chk_subject && $line =~ /^Subject: \[PATCH\] (\s*)(\[.*\])?/i) {
+ my $space_before = $1;
+ my $brace_usage = $2;
+ if (defined $space_before && $space_before ne "") {
+ WARN("BAD_SUBJECT",
+ "Remove leading whitespace on subject\n" . $herecurr);
+ }
+ if (defined $brace_usage && $brace_usage ne "") {
+ WARN("BAD_SUBJECT",
+ "Avoid using '[xxx]' on subject. Use 'xxx:' instead\n" . $herecurr);
+ }
+ if ($lines[$linenr] !~ /^$/) {
+ ERROR("MISSING_BLANK_LINE_AFTER_SUBJECT",
+ "Missing blank line after Subject: line\n" . $herecurr);
+ }
+ }
+
+ #($line =~ /^Subject:/i) && ? 1 : 0;
+
# Check the patch for a signoff:
if ($line =~ /^\s*signed-off-by:/i) {
$signoff++;