Skip to contentSkip to conversation

checkpatch: remove obsolete CONFIG_EXPERIMENTAL checks

PATCH RESEND Applied Ruslan Bilovol 3 participants 4 messages Feb 27, 2017 – Mar 9, 2017 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 checkpatch: remove obsolete CONFIG_EXPERIMENTAL checks

Config EXPERIMENTAL has been removed from kernel in 2013 (see 3d374d0: "final removal of CONFIG_EXPERIMENTAL"), there is no any reason to do these checks now.

---
 scripts/checkpatch.pl | 13 -------------
 1 file changed, 13 deletions(-)
scripts/checkpatch.pl +0 -13
index 982c52c..e0a34e6 100755
@@ -2746,13 +2746,6 @@ sub process {
 			#print "is_start<$is_start> is_end<$is_end> length<$length>\n";
 		}
 
-# discourage the addition of CONFIG_EXPERIMENTAL in Kconfig.
-		if ($realfile =~ /Kconfig/ &&
-		    $line =~ /.\s*depends on\s+.*\bEXPERIMENTAL\b/) {
-			WARN("CONFIG_EXPERIMENTAL",
-			     "Use of CONFIG_EXPERIMENTAL is deprecated. For alternatives, see https://lkml.org/lkml/2012/10/23/580\n");
-		}
-
 # discourage the use of boolean for type definition attributes of Kconfig options
 		if ($realfile =~ /Kconfig/ &&
 		    $line =~ /^\+\s*\bboolean\b/) {
@@ -3146,12 +3139,6 @@ sub process {
 			}
 		}
 
-# discourage the addition of CONFIG_EXPERIMENTAL in #if(def).
-		if ($line =~ /^\+\s*\#\s*if.*\bCONFIG_EXPERIMENTAL\b/) {
-			WARN("CONFIG_EXPERIMENTAL",
-			     "Use of CONFIG_EXPERIMENTAL is deprecated. For alternatives, see https://lkml.org/lkml/2012/10/23/580\n");
-		}
-
 # check for RCS/CVS revision markers
 		if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) {
 			WARN("CVS_KEYWORD",
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Ruslan Bilovol

Config EXPERIMENTAL has been removed from kernel in 2013 (see 3d374d0: "final removal of CONFIG_EXPERIMENTAL"), there is no any reason to do these checks now.

-Kees

Quoted 38 lines
---
 scripts/checkpatch.pl | 13 -------------
 1 file changed, 13 deletions(-)
scripts/checkpatch.pl +0 -14
index 982c52c..e0a34e6 100755
@@ -2746,13 +2746,6 @@ sub process {
                        #print "is_start<$is_start> is_end<$is_end> length<$length>\n";
                }
 
-# discourage the addition of CONFIG_EXPERIMENTAL in Kconfig.
-               if ($realfile =~ /Kconfig/ &&
-                   $line =~ /.\s*depends on\s+.*\bEXPERIMENTAL\b/) {
-                       WARN("CONFIG_EXPERIMENTAL",
-                            "Use of CONFIG_EXPERIMENTAL is deprecated. For alternatives, see https://lkml.org/lkml/2012/10/23/580\n");
-               }
-
 # discourage the use of boolean for type definition attributes of Kconfig options
                if ($realfile =~ /Kconfig/ &&
                    $line =~ /^\+\s*\bboolean\b/) {
@@ -3146,12 +3139,6 @@ sub process {
                        }
                }
 
-# discourage the addition of CONFIG_EXPERIMENTAL in #if(def).
-               if ($line =~ /^\+\s*\#\s*if.*\bCONFIG_EXPERIMENTAL\b/) {
-                       WARN("CONFIG_EXPERIMENTAL",
-                            "Use of CONFIG_EXPERIMENTAL is deprecated. For alternatives, see https://lkml.org/lkml/2012/10/23/580\n");
-               }
-
 # check for RCS/CVS revision markers
                if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) {
                        WARN("CVS_KEYWORD",
--

1.9.1

Signature · 2 lines
Kees Cook
Pixel Security
maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Ruslan Bilovol
Quoted 5 lines · Ruslan Bilovol

Config EXPERIMENTAL has been removed from kernel in 2013 (see 3d374d0: "final removal of CONFIG_EXPERIMENTAL"), there is no any reason to do these checks now.

While I think all the defconfigs that have CONFIG_EXPERIMENTAL should have those lines removed, this seems sensible enough.

$ git grep -w CONFIG_EXPERIMENTAL -- "*defconfig*" | wc -l
216

Here's a little script to remove the CONFIG_EXPERIMENTAL lines from all the defconfigs too:

$ git grep -w --name-only CONFIG_EXPERIMENTAL -- "*defconfig*" | \
  xargs sed -i -e '/CONFIG_EXPERIMENTAL=[yn]/d'
Quoted 35 lines
---
 scripts/checkpatch.pl | 13 -------------
 1 file changed, 13 deletions(-)
scripts/checkpatch.pl +0 -13
index 982c52c..e0a34e6 100755
@@ -2746,13 +2746,6 @@ sub process {
 			#print "is_start<$is_start> is_end<$is_end> length<$length>\n";
 		}
 
-# discourage the addition of CONFIG_EXPERIMENTAL in Kconfig.
-		if ($realfile =~ /Kconfig/ &&
-		    $line =~ /.\s*depends on\s+.*\bEXPERIMENTAL\b/) {
-			WARN("CONFIG_EXPERIMENTAL",
-			     "Use of CONFIG_EXPERIMENTAL is deprecated. For alternatives, see https://lkml.org/lkml/2012/10/23/580\n");
-		}
-
 # discourage the use of boolean for type definition attributes of Kconfig options
 		if ($realfile =~ /Kconfig/ &&
 		    $line =~ /^\+\s*\bboolean\b/) {
@@ -3146,12 +3139,6 @@ sub process {
 			}
 		}
 
-# discourage the addition of CONFIG_EXPERIMENTAL in #if(def).
-		if ($line =~ /^\+\s*\#\s*if.*\bCONFIG_EXPERIMENTAL\b/) {
-			WARN("CONFIG_EXPERIMENTAL",
-			     "Use of CONFIG_EXPERIMENTAL is deprecated. For alternatives, see https://lkml.org/lkml/2012/10/23/580\n");
-		}
-
 # check for RCS/CVS revision markers
 		if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) {
 			WARN("CVS_KEYWORD",
#3 lore raw
Quoted 13 lines · Joe Perches
Quoted 5 lines · Ruslan Bilovol

Config EXPERIMENTAL has been removed from kernel in 2013 (see 3d374d0: "final removal of CONFIG_EXPERIMENTAL"), there is no any reason to do these checks now.

While I think all the defconfigs that have CONFIG_EXPERIMENTAL should have those lines removed, this seems sensible enough.

$ git grep -w CONFIG_EXPERIMENTAL -- "*defconfig*" | wc -l
216
Quoted 7 lines

Here's a little script to remove the CONFIG_EXPERIMENTAL lines from all the defconfigs too:

$ git grep -w --name-only CONFIG_EXPERIMENTAL -- "*defconfig*" | \
  xargs sed -i -e '/CONFIG_EXPERIMENTAL=[yn]/d'

While I originally wanted to remove CONFIG_EXPERIMENTAL from all defconfigs by similar script, then automatically create patch, get mainteiner for each defcofnig and send the patch to it, after doing some investigation here I don't think it make sense.

First of all, I checked if there are any other non-existent config options used in defconfigs (scripts/checkkconfigsymbols.py is very helpful here) and I found there are many of them.

Below are just few of them (for kernel 4.10):

- RCU_CPU_STALL_DETECTOR: removed in 2011 by a00e0d71: "rcu:
Remove conditional compilation for RCU CPU stall warnings", still present in *106* defconfigs

- NET_ETHERNET: removed in 2011 by f860b05: "drivers/net: Kconfig and Makefile cleanup", still present in *145* defconfigs

- MTD_CHAR: removed in 2013 by 660685d "mtd: merge mtdchar module with mtdcore", still present in *98* defconfigs

- INET_LRO removed in 2016 by 7bbf3ca "ipv4: Remove inet_lro library", still present in *192* defconfigs

- NETDEV_10000, NETDEV_1000, MTD_PARTITIONS, MISC_DEVICES, HID_SUPPORT, and more and more....

It seems nobody cares about presence of such non-existent config symbols in defconfig files. Such defcifngs are outdated and at least should be regenerated (instead of sed-ding for each such config option)

Also presence of old non-existent config options in defconfigs may be a good indication of systems that nobody uses or supports, so it will be easy to indentify and remove them from kernel at some time in the future.

So let's keep it as-is.

--
Ruslan

Quoted 36 lines
Quoted 36 lines
---
 scripts/checkpatch.pl | 13 -------------
 1 file changed, 13 deletions(-)
scripts/checkpatch.pl +0 -13
index 982c52c..e0a34e6 100755
@@ -2746,13 +2746,6 @@ sub process {
                      #print "is_start<$is_start> is_end<$is_end> length<$length>\n";
              }
 
-# discourage the addition of CONFIG_EXPERIMENTAL in Kconfig.
-             if ($realfile =~ /Kconfig/ &&
-                 $line =~ /.\s*depends on\s+.*\bEXPERIMENTAL\b/) {
-                     WARN("CONFIG_EXPERIMENTAL",
-                          "Use of CONFIG_EXPERIMENTAL is deprecated. For alternatives, see https://lkml.org/lkml/2012/10/23/580\n");
-             }
-
 # discourage the use of boolean for type definition attributes of Kconfig options
              if ($realfile =~ /Kconfig/ &&
                  $line =~ /^\+\s*\bboolean\b/) {
@@ -3146,12 +3139,6 @@ sub process {
                      }
              }
 
-# discourage the addition of CONFIG_EXPERIMENTAL in #if(def).
-             if ($line =~ /^\+\s*\#\s*if.*\bCONFIG_EXPERIMENTAL\b/) {
-                     WARN("CONFIG_EXPERIMENTAL",
-                          "Use of CONFIG_EXPERIMENTAL is deprecated. For alternatives, see https://lkml.org/lkml/2012/10/23/580\n");
-             }
-
 # check for RCS/CVS revision markers
              if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) {
                      WARN("CVS_KEYWORD",