Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kconfig: make allnoconfig disable options behind EMBEDDED and EXPERT

"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>

authored by

Josh Triplett and committed by
Linus Torvalds
5d2acfc7 527518f1

+25 -6
+4
Documentation/kbuild/kconfig-language.txt
··· 157 157 to the build environment (if this is desired, it can be done via 158 158 another symbol). 159 159 160 + - "allnoconfig_y" 161 + This declares the symbol as one that should have the value y when 162 + using "allnoconfig". Used for symbols that hide other symbols. 163 + 160 164 Menu dependencies 161 165 ----------------- 162 166
+1
init/Kconfig
··· 1483 1483 1484 1484 config EMBEDDED 1485 1485 bool "Embedded system" 1486 + option allnoconfig_y 1486 1487 select EXPERT 1487 1488 help 1488 1489 This option should be enabled if compiling the kernel for
+4 -1
scripts/kconfig/confdata.c
··· 1178 1178 sym->def[S_DEF_USER].tri = mod; 1179 1179 break; 1180 1180 case def_no: 1181 - sym->def[S_DEF_USER].tri = no; 1181 + if (sym->flags & SYMBOL_ALLNOCONFIG_Y) 1182 + sym->def[S_DEF_USER].tri = yes; 1183 + else 1184 + sym->def[S_DEF_USER].tri = no; 1182 1185 break; 1183 1186 case def_random: 1184 1187 sym->def[S_DEF_USER].tri = no;
+3
scripts/kconfig/expr.h
··· 109 109 /* choice values need to be set before calculating this symbol value */ 110 110 #define SYMBOL_NEED_SET_CHOICE_VALUES 0x100000 111 111 112 + /* Set symbol to y if allnoconfig; used for symbols that hide others */ 113 + #define SYMBOL_ALLNOCONFIG_Y 0x200000 114 + 112 115 #define SYMBOL_MAXLENGTH 256 113 116 #define SYMBOL_HASHSIZE 9973 114 117
+1
scripts/kconfig/lkc.h
··· 61 61 #define T_OPT_MODULES 1 62 62 #define T_OPT_DEFCONFIG_LIST 2 63 63 #define T_OPT_ENV 3 64 + #define T_OPT_ALLNOCONFIG_Y 4 64 65 65 66 struct kconf_id { 66 67 int name;
+3
scripts/kconfig/menu.c
··· 217 217 case T_OPT_ENV: 218 218 prop_add_env(arg); 219 219 break; 220 + case T_OPT_ALLNOCONFIG_Y: 221 + current_entry->sym->flags |= SYMBOL_ALLNOCONFIG_Y; 222 + break; 220 223 } 221 224 } 222 225
+1
scripts/kconfig/zconf.gperf
··· 44 44 modules, T_OPT_MODULES, TF_OPTION 45 45 defconfig_list, T_OPT_DEFCONFIG_LIST,TF_OPTION 46 46 env, T_OPT_ENV, TF_OPTION 47 + allnoconfig_y, T_OPT_ALLNOCONFIG_Y,TF_OPTION 47 48 %%
+8 -5
scripts/kconfig/zconf.hash.c_shipped
··· 55 55 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 56 56 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 57 57 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 58 - 73, 73, 73, 73, 73, 73, 73, 73, 25, 25, 58 + 73, 73, 73, 73, 73, 73, 73, 5, 25, 25, 59 59 0, 0, 0, 5, 0, 0, 73, 73, 5, 0, 60 60 10, 5, 45, 73, 20, 20, 0, 15, 15, 73, 61 - 20, 73, 73, 73, 73, 73, 73, 73, 73, 73, 61 + 20, 5, 73, 73, 73, 73, 73, 73, 73, 73, 62 62 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 63 63 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 64 64 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, ··· 106 106 char kconf_id_strings_str23[sizeof("mainmenu")]; 107 107 char kconf_id_strings_str25[sizeof("menuconfig")]; 108 108 char kconf_id_strings_str27[sizeof("modules")]; 109 + char kconf_id_strings_str28[sizeof("allnoconfig_y")]; 109 110 char kconf_id_strings_str29[sizeof("menu")]; 110 111 char kconf_id_strings_str31[sizeof("select")]; 111 112 char kconf_id_strings_str32[sizeof("comment")]; ··· 142 141 "mainmenu", 143 142 "menuconfig", 144 143 "modules", 144 + "allnoconfig_y", 145 145 "menu", 146 146 "select", 147 147 "comment", ··· 172 170 { 173 171 enum 174 172 { 175 - TOTAL_KEYWORDS = 32, 173 + TOTAL_KEYWORDS = 33, 176 174 MIN_WORD_LENGTH = 2, 177 175 MAX_WORD_LENGTH = 14, 178 176 MIN_HASH_VALUE = 2, ··· 221 219 {-1}, 222 220 #line 44 "scripts/kconfig/zconf.gperf" 223 221 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION}, 224 - {-1}, 222 + #line 47 "scripts/kconfig/zconf.gperf" 223 + {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_OPT_ALLNOCONFIG_Y,TF_OPTION}, 225 224 #line 16 "scripts/kconfig/zconf.gperf" 226 225 {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND}, 227 226 {-1}, ··· 285 282 } 286 283 return 0; 287 284 } 288 - #line 47 "scripts/kconfig/zconf.gperf" 285 + #line 48 "scripts/kconfig/zconf.gperf" 289 286