diff options
author | Joe Perches <joe@perches.com> | 2014-06-04 19:12:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-04 19:54:20 -0400 |
commit | 2ac73b4f685e699ccdfa6855e826df846999d577 (patch) | |
tree | b158f925016d0a6754029c8fefd58c834fe60da5 /scripts | |
parent | 3f7bac031c6ba61c89b06b279f74a25309da1625 (diff) |
checkpatch: make --strict a default for files in drivers/net and net/
Networking files are generally more strictly conformant to linux-kernel
style so make checkpatch more verbose by default for patches to files or
when checking files in these directories.
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f2ef63a2e8d4..bb4c8428f333 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -24,6 +24,7 @@ my $emacs = 0; | |||
24 | my $terse = 0; | 24 | my $terse = 0; |
25 | my $file = 0; | 25 | my $file = 0; |
26 | my $check = 0; | 26 | my $check = 0; |
27 | my $check_orig = 0; | ||
27 | my $summary = 1; | 28 | my $summary = 1; |
28 | my $mailback = 0; | 29 | my $mailback = 0; |
29 | my $summary_file = 0; | 30 | my $summary_file = 0; |
@@ -146,6 +147,7 @@ GetOptions( | |||
146 | help(0) if ($help); | 147 | help(0) if ($help); |
147 | 148 | ||
148 | $fix = 1 if ($fix_inplace); | 149 | $fix = 1 if ($fix_inplace); |
150 | $check_orig = $check; | ||
149 | 151 | ||
150 | my $exit = 0; | 152 | my $exit = 0; |
151 | 153 | ||
@@ -1813,11 +1815,13 @@ sub process { | |||
1813 | $here = "#$linenr: " if (!$file); | 1815 | $here = "#$linenr: " if (!$file); |
1814 | $here = "#$realline: " if ($file); | 1816 | $here = "#$realline: " if ($file); |
1815 | 1817 | ||
1818 | my $found_file = 0; | ||
1816 | # extract the filename as it passes | 1819 | # extract the filename as it passes |
1817 | if ($line =~ /^diff --git.*?(\S+)$/) { | 1820 | if ($line =~ /^diff --git.*?(\S+)$/) { |
1818 | $realfile = $1; | 1821 | $realfile = $1; |
1819 | $realfile =~ s@^([^/]*)/@@ if (!$file); | 1822 | $realfile =~ s@^([^/]*)/@@ if (!$file); |
1820 | $in_commit_log = 0; | 1823 | $in_commit_log = 0; |
1824 | $found_file = 1; | ||
1821 | } elsif ($line =~ /^\+\+\+\s+(\S+)/) { | 1825 | } elsif ($line =~ /^\+\+\+\s+(\S+)/) { |
1822 | $realfile = $1; | 1826 | $realfile = $1; |
1823 | $realfile =~ s@^([^/]*)/@@ if (!$file); | 1827 | $realfile =~ s@^([^/]*)/@@ if (!$file); |
@@ -1834,6 +1838,15 @@ sub process { | |||
1834 | ERROR("MODIFIED_INCLUDE_ASM", | 1838 | ERROR("MODIFIED_INCLUDE_ASM", |
1835 | "do not modify files in include/asm, change architecture specific files in include/asm-<architecture>\n" . "$here$rawline\n"); | 1839 | "do not modify files in include/asm, change architecture specific files in include/asm-<architecture>\n" . "$here$rawline\n"); |
1836 | } | 1840 | } |
1841 | $found_file = 1; | ||
1842 | } | ||
1843 | |||
1844 | if ($found_file) { | ||
1845 | if ($realfile =~ m@^(drivers/net/|net/)@) { | ||
1846 | $check = 1; | ||
1847 | } else { | ||
1848 | $check = $check_orig; | ||
1849 | } | ||
1837 | next; | 1850 | next; |
1838 | } | 1851 | } |
1839 | 1852 | ||