aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2012-12-17 19:01:48 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-17 20:15:18 -0500
commit1ba8dfd17ead04de18bfca7b68c2a144c8be736a (patch)
treed9f42871b6809cd40e03557bc243a11d6039dd20 /scripts/checkpatch.pl
parent5023d3472d444747bfa12e9798d7993e7efb8287 (diff)
checkpatch: warn about using CONFIG_EXPERIMENTAL
This config item has not carried much meaning for a while now and is almost always enabled by default. As agreed during the Linux kernel summit, it is being removed. This will discourage future addition of CONFIG_EXPERIMENTAL while it is being phased out. Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Andy Whitcroft <apw@canonical.com> Cc: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d4f61a6fed5d..cd251d5f3f1a 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1757,6 +1757,13 @@ sub process {
1757 #print "is_start<$is_start> is_end<$is_end> length<$length>\n"; 1757 #print "is_start<$is_start> is_end<$is_end> length<$length>\n";
1758 } 1758 }
1759 1759
1760# discourage the addition of CONFIG_EXPERIMENTAL in Kconfig.
1761 if ($realfile =~ /Kconfig/ &&
1762 $line =~ /.\s*depends on\s+.*\bEXPERIMENTAL\b/) {
1763 WARN("CONFIG_EXPERIMENTAL",
1764 "Use of CONFIG_EXPERIMENTAL is deprecated. For alternatives, see https://lkml.org/lkml/2012/10/23/580\n");
1765 }
1766
1760 if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) && 1767 if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) &&
1761 ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) { 1768 ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) {
1762 my $flag = $1; 1769 my $flag = $1;
@@ -1912,6 +1919,12 @@ sub process {
1912# check we are in a valid C source file if not then ignore this hunk 1919# check we are in a valid C source file if not then ignore this hunk
1913 next if ($realfile !~ /\.(h|c)$/); 1920 next if ($realfile !~ /\.(h|c)$/);
1914 1921
1922# discourage the addition of CONFIG_EXPERIMENTAL in #if(def).
1923 if ($line =~ /^\+\s*\#\s*if.*\bCONFIG_EXPERIMENTAL\b/) {
1924 WARN("CONFIG_EXPERIMENTAL",
1925 "Use of CONFIG_EXPERIMENTAL is deprecated. For alternatives, see https://lkml.org/lkml/2012/10/23/580\n");
1926 }
1927
1915# check for RCS/CVS revision markers 1928# check for RCS/CVS revision markers
1916 if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) { 1929 if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) {
1917 WARN("CVS_KEYWORD", 1930 WARN("CVS_KEYWORD",