Skip to content

Commit 1ba8dfd

Browse files
keestorvalds
authored andcommitted
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 <[email protected]> Cc: Andy Whitcroft <[email protected]> Cc: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 5023d34 commit 1ba8dfd

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

scripts/checkpatch.pl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,6 +1757,13 @@ sub process {
17571757
#print "is_start<$is_start> is_end<$is_end> length<$length>\n";
17581758
}
17591759

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+
17601767
if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) &&
17611768
($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) {
17621769
my $flag = $1;
@@ -1912,6 +1919,12 @@ sub process {
19121919
# check we are in a valid C source file if not then ignore this hunk
19131920
next if ($realfile !~ /\.(h|c)$/);
19141921

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+
19151928
# check for RCS/CVS revision markers
19161929
if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) {
19171930
WARN("CVS_KEYWORD",

0 commit comments

Comments
 (0)