kconfig: make allnoconfig disable options behind EMBEDDED and EXPERT
authorJosh Triplett <josh@joshtriplett.org>
Mon, 7 Apr 2014 22:39:09 +0000 (15:39 -0700)
committerChristian Lamparter <chunkeey@googlemail.com>
Thu, 1 Jan 2015 16:47:22 +0000 (17:47 +0100)
"make allnoconfig" exists to ease testing of minimal configurations.
Documentation/SubmitChecklist includes a note to test with allnoconfig.
This helps catch missing dependencies on common-but-not-required
functionality, which might otherwise go unnoticed.

However, allnoconfig still leaves many symbols enabled, because they're
hidden behind CONFIG_EMBEDDED or CONFIG_EXPERT.  For instance, allnoconfig
still has CONFIG_PRINTK and CONFIG_BLOCK enabled, so drivers don't
typically get build-tested with those disabled.

To address this, introduce a new Kconfig option "allnoconfig_y", used on
symbols which only exist to hide other symbols.  Set it on CONFIG_EMBEDDED
(which then selects CONFIG_EXPERT).  allnoconfig will then disable all the
symbols hidden behind those.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
config/confdata.c
config/expr.h
config/lkc.h
config/menu.c
config/zconf.gperf

index a856c19c1cbc813fe1ae9bb22dfa04941f9be143..58ac13f0d98b01ad60ef842f37ed85052041e1c0 100644 (file)
@@ -1241,7 +1241,10 @@ bool conf_set_all_new_symbols(enum conf_def_mode mode)
                                sym->def[S_DEF_USER].tri = mod;
                                break;
                        case def_no:
-                               sym->def[S_DEF_USER].tri = no;
+                               if (sym->flags & SYMBOL_ALLNOCONFIG_Y)
+                                       sym->def[S_DEF_USER].tri = yes;
+                               else
+                                       sym->def[S_DEF_USER].tri = no;
                                break;
                        case def_random:
                                sym->def[S_DEF_USER].tri = no;
index ba663e1dc7e35b7bf732c4863c1202e3249ac636..412ea8a2abb8b80c6f0a889e2fb9d7b55bf0bafa 100644 (file)
@@ -109,6 +109,9 @@ struct symbol {
 /* choice values need to be set before calculating this symbol value */
 #define SYMBOL_NEED_SET_CHOICE_VALUES  0x100000
 
+/* Set symbol to y if allnoconfig; used for symbols that hide others */
+#define SYMBOL_ALLNOCONFIG_Y 0x200000
+
 #define SYMBOL_MAXLENGTH       256
 #define SYMBOL_HASHSIZE                9973
 
index 09f4edfdc91132887e1e54e09faf1a9b99865965..d5daa7af8b496e89143b3fd222fc3c35e7eeb748 100644 (file)
@@ -61,6 +61,7 @@ enum conf_def_mode {
 #define T_OPT_MODULES          1
 #define T_OPT_DEFCONFIG_LIST   2
 #define T_OPT_ENV              3
+#define T_OPT_ALLNOCONFIG_Y    4
 
 struct kconf_id {
        int name;
index db1512ae30cc48d6f2ea87bc26a082a084551811..3ac2c9c6e280300275920d2ea1cadb0c7be66746 100644 (file)
@@ -217,6 +217,9 @@ void menu_add_option(int token, char *arg)
        case T_OPT_ENV:
                prop_add_env(arg);
                break;
+       case T_OPT_ALLNOCONFIG_Y:
+               current_entry->sym->flags |= SYMBOL_ALLNOCONFIG_Y;
+               break;
        }
 }
 
index dd8ec26904ac3a6988d78a11c3afd355d9a5467e..f639adb0fb943daaee3d0c069277e990070d4d23 100644 (file)
@@ -44,4 +44,5 @@ on,           T_ON,           TF_PARAM
 modules,       T_OPT_MODULES,  TF_OPTION
 defconfig_list,        T_OPT_DEFCONFIG_LIST,TF_OPTION
 env,           T_OPT_ENV,      TF_OPTION
+allnoconfig_y, T_OPT_ALLNOCONFIG_Y,TF_OPTION
 %%