summaryrefslogtreecommitdiff
path: root/scripts/kconfig
AgeCommit message (Collapse)AuthorFilesLines
2022-02-23kconfig: fix failing to generate auto.confJing Leng1-4/+9
[ Upstream commit 1b9e740a81f91ae338b29ed70455719804957b80 ] When the KCONFIG_AUTOCONFIG is specified (e.g. export \ KCONFIG_AUTOCONFIG=output/config/auto.conf), the directory of include/config/ will not be created, so kconfig can't create deps files in it and auto.conf can't be generated. Signed-off-by: Jing Leng <jleng@ambarella.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-02-23kconfig: let 'shell' return enough output for deep path namesBrenda Streiff1-1/+1
[ Upstream commit 8a4c5b2a6d8ea079fa36034e8167de87ab6f8880 ] The 'shell' built-in only returns the first 256 bytes of the command's output. In some cases, 'shell' is used to return a path; by bumping up the buffer size to 4096 this lets us capture up to PATH_MAX. The specific case where I ran into this was due to commit 1e860048c53e ("gcc-plugins: simplify GCC plugin-dev capability test"). After this change, we now use `$(shell,$(CC) -print-file-name=plugin)` to return a path; if the gcc path is particularly long, then the path ends up truncated at the 256 byte mark, which makes the HAVE_GCC_PLUGINS depends test always fail. Signed-off-by: Brenda Streiff <brenda.streiff@ni.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-08-10scripts: merge_config: add strict mode to fail upon any redefinitionMatthias Maennich1-0/+15
When merging configuration fragments, it might be of interest to identify mismatches (redefinitions) programmatically. Hence add the option -s (strict mode) to instruct merge_config.sh to bail out in case any redefinition has been detected. With strict mode, warnings are emitted as before, but the script terminates with rc=1. If -y is set to define "builtin having precedence over modules", fragments are still allowed to set =m (while the base config has =y). Strict mode will tolerate that as demotions from =y to =m are ignored when setting -y. Signed-off-by: Matthias Maennich <maennich@google.com> Reviewed-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-07-10Merge tag 'kbuild-v5.14' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild updates from Masahiro Yamada: - Increase the -falign-functions alignment for the debug option. - Remove ugly libelf checks from the top Makefile. - Make the silent build (-s) more silent. - Re-compile the kernel if KBUILD_BUILD_TIMESTAMP is specified. - Various script cleanups * tag 'kbuild-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (27 commits) scripts: add generic syscallnr.sh scripts: check duplicated syscall number in syscall table sparc: syscalls: use pattern rules to generate syscall headers parisc: syscalls: use pattern rules to generate syscall headers nds32: add arch/nds32/boot/.gitignore kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set kbuild: modpost: Explicitly warn about unprototyped symbols kbuild: remove trailing slashes from $(KBUILD_EXTMOD) kconfig.h: explain IS_MODULE(), IS_ENABLED() kconfig: constify long_opts scripts/setlocalversion: simplify the short version part scripts/setlocalversion: factor out 12-chars hash construction scripts/setlocalversion: add more comments to -dirty flag detection scripts/setlocalversion: remove workaround for old make-kpkg scripts/setlocalversion: remove mercurial, svn and git-svn supports kbuild: clean up ${quiet} checks in shell scripts kbuild: sink stdout from cmd for silent build init: use $(call cmd,) for generating include/generated/compile.h kbuild: merge scripts/mkmakefile to top Makefile sh: move core-y in arch/sh/Makefile to arch/sh/Kbuild ...
2021-06-29streamline_config.pl: add softtabstop=4 for vim usersSteven Rostedt (VMware)1-0/+2
The tab stop for Perl files is by default (at least in emacs) to be 4 spaces, where a tab is used for all 8 spaces. Add a local variable comment to make vim do the same by default, and this will help keep the file consistent in the future when others edit it via vim and not emacs. Link: https://lkml.kernel.org/r/20210322214032.293992979@goodmis.org Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: "John (Warthog9) Hawley" <warthog9@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-06-29streamline_config.pl: make spacing consistentSteven Rostedt (VMware)1-39/+39
Patch series "streamline_config.pl: Fix Perl spacing". Talking with John Hawley about how vim and emacs deal with Perl files with respect to tabs and spaces, I found that some of my Perl code in the kernel had inconsistent spacing. The way emacs handles Perl by default is to use 4 spaces per indent, but make all 8 spaces into a single tab. Vim does not do this by default. But if you add the vim variable control: # vim: softtabstop=4 to a perl file, it makes vim behave the same way as emacs. The first patch is to change all 8 spaces into a single tab (mostly from people editing the file with vim). The next patch adds the softtabstop variable to make vim act like emacs by default. This patch (of 2): As Perl code tends to have 4 space indentation, but uses tabs for every 8 spaces, make that consistent in the streamline_config.pl code. Replace all 8 spaces with a single tab. Link: https://lkml.kernel.org/r/20210322214032.133596267@goodmis.org Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Cc: "John (Warthog9) Hawley" <warthog9@kernel.org> Cc: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-06-05kconfig: constify long_optsMasahiro Yamada1-1/+1
getopt_long() does not modify the long_opts structure. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-30Merge tag 'kconfig-v5.13' of ↵Linus Torvalds24-635/+559
git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kconfig updates from Masahiro Yamada: - Change 'option defconfig' to the environment variable KCONFIG_DEFCONFIG_LIST - Refactor tinyconfig without using allnoconfig_y - Remove 'option allnoconfig_y' syntax - Change 'option modules' to 'modules' - Do not use /boot/config-* etc. as base config for cross-compilation - Fix a search bug in nconf - Various code cleanups * tag 'kconfig-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (34 commits) kconfig: refactor .gitignore kconfig: highlight xconfig 'comment' lines with '***' kconfig: highlight gconfig 'comment' lines with '***' kconfig: gconf: remove unused code kconfig: remove unused PACKAGE definition kconfig: nconf: stop endless search loops kconfig: split menu.c out of parser.y kconfig: nconf: refactor in print_in_middle() kconfig: nconf: remove meaningless wattrset() call from show_menu() kconfig: nconf: change set_config_filename() to void function kconfig: nconf: refactor attributes setup code kconfig: nconf: remove unneeded default for menu prompt kconfig: nconf: get rid of (void) casts from wattrset() calls kconfig: nconf: fix NORMAL attributes kconfig: mconf,nconf: remove unneeded '\0' termination after snprintf() kconfig: use /boot/config-* etc. as DEFCONFIG_LIST only for native build kconfig: change sym_change_count to a boolean flag kconfig: nconf: fix core dump when searching in empty menu kconfig: lxdialog: A spello fix and a punctuation added kconfig: streamline_config.pl: Couple of typo fixes ...
2021-04-25kconfig: refactor .gitignoreMasahiro Yamada1-10/+3
Add '/' prefix to clarify that the generated files exist right under scripts/kconfig/, but not in any sub-directory. Replace '*conf-cfg' with '[gmnq]conf-cfg' to make it explicit, and still short enough. Use '[gmnq]conf' to combine gconf, mconf, nconf, and qconf. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-24kbuild: redo fake deps at include/config/*.hAlexey Dobriyan1-10/+5
Make include/config/foo/bar.h fake deps files generation simpler. * delete .h suffix those aren't header files, shorten filenames, * delete tolower() Linux filesystems can deal with both upper and lowercase filenames very well, * put everything in 1 directory Presumably 'mkdir -p' split is from dark times when filesystems handled huge directories badly, disks were round adding to seek times. x86_64 allmodconfig lists 12364 files in include/config. ../obj/include/config/ ├── 104_QUAD_8 ├── 60XX_WDT ├── 64BIT ... ├── ZSWAP_DEFAULT_ON ├── ZSWAP_ZPOOL_DEFAULT └── ZSWAP_ZPOOL_DEFAULT_ZBUD 0 directories, 12364 files Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-19kconfig: highlight xconfig 'comment' lines with '***'Randy Dunlap1-0/+1
Mark Kconfig "comment" lines with "*** <commentstring> ***" so that it is clear that these lines are comments and not some kconfig item that cannot be modified. This is helpful in some menus to be able to provide a menu "sub-heading" for groups of similar config items. This also makes the comments be presented in a way that is similar to menuconfig and nconfig. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-19kconfig: highlight gconfig 'comment' lines with '***'Randy Dunlap1-2/+6
Mark Kconfig "comment" lines with "*** <commentstring> ***" so that it is clear that these lines are comments and not some kconfig item that cannot be modified. This is helpful in some menus to be able to provide a menu "sub-heading" for groups of similar config items. This also makes the comments be presented in a way that is similar to menuconfig and nconfig. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-19kconfig: gconf: remove unused codeMasahiro Yamada1-7/+0
Remove the unused <config.h> inclusion, and commented out lines. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-19kconfig: remove unused PACKAGE definitionMasahiro Yamada1-4/+0
Commit 3b9fa0931dd8 ("[PATCH] Kconfig i18n support") added this code, and then commit ("kconfig: drop localization support") removed the i18n support entirely. Remove the left-over. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-16kconfig: nconf: stop endless search loopsMihai Moldovan1-1/+1
If the user selects the very first entry in a page and performs a search-up operation, or selects the very last entry in a page and performs a search-down operation that will not succeed (e.g., via [/]asdfzzz[Up Arrow]), nconf will never terminate searching the page. The reason is that in this case, the starting point will be set to -1 or n, which is then translated into (n - 1) (i.e., the last entry of the page) or 0 (i.e., the first entry of the page) and finally the search begins. This continues to work fine until the index reaches 0 or (n - 1), at which point it will be decremented to -1 or incremented to n, but not checked against the starting point right away. Instead, it's wrapped around to the bottom or top again, after which the starting point check occurs... and naturally fails. My original implementation added another check for -1 before wrapping the running index variable around, but Masahiro Yamada pointed out that the actual issue is that the comparison point (starting point) exceeds bounds (i.e., the [0,n-1] interval) in the first place and that, instead, the starting point should be fixed. This has the welcome side-effect of also fixing the case where the starting point was n while searching down, which also lead to an infinite loop. OTOH, this code is now essentially all his work. Amazingly, nobody seems to have been hit by this for 11 years - or at the very least nobody bothered to debug and fix this. Signed-off-by: Mihai Moldovan <ionic@ionic.de> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: split menu.c out of parser.yMasahiro Yamada4-5/+14
Compile menu.c as an independent compilation unit. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: nconf: refactor in print_in_middle()Masahiro Yamada3-34/+6
This helper is the same as the sample code in the NCURSES HOWTO [1], but it is over-engineering to be used for nconf. I do not see any good reason to use the 'float' type just for the division by 2. All the call-sites pass a non-NULL pointer to the first argument, so 'if (win == NULL) win = stdscr;' is dead code. 'if (startx != 0) x = startx;' is dead code because 'x' will be overridden some lines below, by 'x = startx + (int)temp;'. All the call-sites pass a non-zero value to the second argument, so 'if (starty != 0)' is always true. getyx(win, y, x) is also dead-code because both 'y' and 'x' are overridden. All the call-sites pass 0 to the third parameter, so 'startx' can be removed. All the call-sites pass a non-zero value to the fourth parameter, so 'if (width == 0) width = 80;' is dead code. The window will be refreshed later, so there is no need to call refresh() in this function. Change the type of the last parameter from 'chtype' to 'int' to be aligned with the prototype, 'int wattrset(WINDOW *win, int attrs);' I also slightly cleaned up the indentation style. [1]: https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/color.html Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: nconf: remove meaningless wattrset() call from show_menu()Masahiro Yamada1-1/+0
This attribute is not used because it will be overridden some lines below: wattrset(main_window, attr_main_menu_box); Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: nconf: change set_config_filename() to void functionMasahiro Yamada1-2/+1
No one uses the return value of this function. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: nconf: refactor attributes setup codeMasahiro Yamada3-175/+144
The current attributes setup code is strange; the array attribute[] is set to values outside the range of the attribute_t enum. At least, attributes_t attributes[ATTR_MAX+1] = {0}; ... should be int attribute[ATTR_MAX+1] = {0}; Also, there is no need to hard-code the color-pair numbers in attributes_t. The current code is messy. Rewrite it. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: nconf: remove unneeded default for menu promptMasahiro Yamada1-4/+2
The rootmenu always has a prompt even if the 'mainmenu' statement is missing in the top Kconfig file. conf_parse() calls menu_add_prompt(P_MENU, "Main menu", NULL) in this case. So, every 'menu' has a prompt. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: nconf: get rid of (void) casts from wattrset() callsMasahiro Yamada2-17/+17
This reverts commit 10175ba65fde ("nconfig: Silence unused return values from wattrset"). With this patch applied, recent GCC versions can cleanly build nconf without "value computed is not used" warnings. The wattrset() used to be implemented as a macro, like this: #define wattrset(win,at) \ (NCURSES_OK_ADDR(win) \ ? ((win)->_attrs = NCURSES_CAST(attr_t, at), \ OK) \ : ERR) The GCC bugzilla [1] reported a false-positive -Wunused-value warning in a similar test case. It was fixed by GCC 4.4.1. Let's revert that commit, and see if somebody will claim the issue. [1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39889 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: nconf: fix NORMAL attributesMasahiro Yamada1-2/+2
The lower 8-bit of attributes should be 0, but this code wrongly sets it to NORMAL (=1). The correct one is A_NORMAL. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: mconf,nconf: remove unneeded '\0' termination after snprintf()Masahiro Yamada2-17/+6
snprintf() always terminates the destination buffer with '\0' even if the buffer is not long enough. (In this case, the last element of the buffer becomes '\0'.) The explicit termination is unneeded. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: use /boot/config-* etc. as DEFCONFIG_LIST only for native buildMasahiro Yamada1-4/+4
When the .config file is missing, 'make config', 'make menuconfig', etc. uses a file listed in DEFCONFIG_LIST, if found, as base configuration. Ususally, /boot/config-$(uname -r) exists, and is used as default. However, when you are cross-compiling the kernel, it does not make sense to use /boot/config-* on the build host. It should default to arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG). UML previously did not use DEFCONFIG_LIST at all, but it should be able to use arch/um/configs/$(KBUILD_DEFCONFIG) as a base config file. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: change sym_change_count to a boolean flagMasahiro Yamada7-24/+18
sym_change_count has no good reason to be 'int' type. sym_set_change_count() compares the old and new values after casting both of them to (bool). I do not see any practical diffrence between sym_set_change_count(1) and sym_add_change_count(1). Use the boolean flag, conf_changed. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: nconf: fix core dump when searching in empty menuMasahiro Yamada1-3/+7
The following code in get_mext_match(): index = (index + items_num) % items_num; ... makes the program crash when items_num is zero (that is, the menu is empty). A menu can be empty when all the options in it are hidden by unmet 'depends on'. For example, menu "This menu will be empty" config FOO bool "foo" depends on BROKEN endmenu If you visit this menu and press a '/' key and then another key, nconf crashes with: Floating point exception (core dumped) When the number of items is zero, it does not make sense to search in the menu. In this case, current_item() returns NULL, and item_index() ERR, but get_mext_match() does not check it. Let's make get_mext_match() just return if the menu is empty. While I am here, change items_num from 'int' to 'unsigned int' because it should never become negative. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: lxdialog: A spello fix and a punctuation addedBhaskar Chowdhury1-2/+2
s/propperly/properly/ s/thats/that\'s/ Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: streamline_config.pl: Couple of typo fixesBhaskar Chowdhury1-2/+2
s/configuraton/configuration/ s/orignal/original/ Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: use true and false for bool variableYang Li1-1/+1
fixed the following coccicheck: ./scripts/kconfig/confdata.c:36:9-10: WARNING: return of 0/1 in function 'is_dir' with return type bool Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: change "modules" from sub-option to first-level attributeMasahiro Yamada7-16/+8
Now "modules" is the only member of the "option" property. Remove "option", and move "modules" to the top level property. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: remove allnoconfig_y optionMasahiro Yamada6-20/+1
Now that the only user, CONFIG_EMBEDDED has stopped using this option, remove it entirely. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: do not use allnoconfig_y optionMasahiro Yamada1-1/+2
allnoconfig_y is an ugly hack that sets a symbol to 'y' by allnoconfig. allnoconfig does not mean a minimal set of CONFIG options because a bunch of prompts are hidden by 'if EMBEDDED' or 'if EXPERT', but I do not like to hack Kconfig this way. Use the pre-existing feature, KCONFIG_ALLCONFIG, to provide a one liner config fragment. CONFIG_EMBEDDED=y is still forced when allnoconfig is invoked as a part of tinyconfig. No change in the .config file produced by 'make tinyconfig'. The output of 'make allnoconfig' will be changed; we will get CONFIG_EMBEDDED=n because allnoconfig literally sets all symbols to n. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: move default KBUILD_DEFCONFIG back to scripts/kconfig/MakefileMasahiro Yamada1-0/+4
This is a partial revert of commit 2a86f6612164 ("kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST"). Now that the reference to $(DEFCONFIG_LIST) was removed from init/Kconfig, the default KBUILD_DEFCONFIG can go back home. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: change defconfig_list option to environment variableMasahiro Yamada9-29/+42
"defconfig_list" is a weird option that defines a static symbol that declares the list of base config files in case the .config does not exist yet. This is quite different from other normal symbols; we just abused the "string" type and the "default" properties to list out the input files. They must be fixed values since these are searched for and loaded in the parse stage. It is an ugly hack, and should not exist in the first place. Providing this feature as an environment variable is a saner approach. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: move JUMP_NB to mconf.cMasahiro Yamada2-2/+2
This macro is only used in mconf.c. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14kconfig: move conf_set_all_new_symbols() to conf.cMasahiro Yamada3-187/+193
This function is only used in conf.c. Move it there together with the randomize_choice_values() helper. Define 'enum conf_def_mode' locally in conf.c as well. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-03-25kconfig: move conf_rewrite_mod_or_yes() to conf.cMasahiro Yamada3-16/+15
This function is only used in conf.c. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-03-25kconfig: remove assignment for Kconfig fileMasahiro Yamada1-2/+1
Pass av[optind] to conf_parse() directly. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-03-25kconfig: add help messages for --help (-h) and --silent (-s)Masahiro Yamada1-3/+7
Add missing options and make the help message more readable. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-03-25kconfig: add long options --help and --silentMasahiro Yamada1-0/+2
They are long options for -h and -s, respectively. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-03-25kconfig: refactor option parse codeMasahiro Yamada1-48/+43
The current option parse code is clumsy. The 's' option is separately handled in an if-conditional due to the following code: input_mode = (enum input_mode)opt; If 's' is moved to the switch statement, the invalid value 's' would be assigned to the input_mode. Another potential problem is that we are mixing 'enum input_mode' and ASCII characters. They could overwrap if we add more input modes. To separate them out, set the flag field of long options to a pointer of input_mode_opt. For mode select options, getopt_long() returns 0, which never causes overwrap with ASCII characters that represent short options. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-03-25kconfig: split randconfig setup code into set_randconfig_seed()Masahiro Yamada1-23/+31
This code is too big to be placed in the switch statement. Move the code into a new helper function. I slightly refactor the code without changing the behavior. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-02-24kconfig: unify rule of config, menuconfig, nconfig, gconfig, xconfigMasahiro Yamada1-22/+14
Unify the similar build rules. This supports 'make build_config', which builds scripts/kconfig/conf but does not invoke it. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-02-24kconfig: omit --oldaskconfig option for 'make config'Masahiro Yamada2-1/+2
scripts/kconfig/conf.c line 39 defines the default of input_mode as oldaskconfig. Hence, 'make config' works in the same way even without the --oldaskconfig option given. Note this in the help message. This will be helpful to unify build rules in Makefile in the next commit. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-02-24kconfig: fix 'invalid option' for help optionMasahiro Yamada1-2/+2
scripts/kconfig/conf supports -? option to show the help message. This is not wired up to Makefile, so nobody would notice this, but it also shows 'invalid option' message. $ ./scripts/kconfig/conf -? ./scripts/kconfig/conf: invalid option -- '?' Usage: ./scripts/kconfig/conf [-s] [option] <kconfig-file> [option] is _one_ of the following: --listnewconfig List new options --helpnewconfig List new options and help text --oldaskconfig Start a new configuration using a line-oriented program ... The reason is the '?' is missing in the short option list passed to getopt_long(). While I fixed this issue, I also changed the option '?' to 'h'. I prefer -h (or --help, if a long option is also desired). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-02-24kconfig: remove dead code in conf_askvalue()Masahiro Yamada1-15/+1
conf_askvalue() is only called for oldconfig, syncconfig, and oldaskconfig. If it is called for other cases, it is a bug. So, the code after the switch statement is unreachable. Remove the dead code, and clean up the switch statement. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-02-24kconfig: clean up nested if-conditionals in check_conf()Masahiro Yamada1-26/+29
Unify the outer two if-conditionals into one. This decreases the indent level by one. Also, change the if-else blocks: if (input_mode == listnewconfig) { ... } else if (input_mode == helpnewconfig) { ... } else { ... } into the switch statement. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-02-24kconfig: Remove duplicate call to sym_get_string_value()Mickaël Salaün1-1/+1
Use the saved returned value of sym_get_string_value() instead of calling it twice. Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com> Link: https://lore.kernel.org/r/20210215181511.2840674-2-mic@digikod.net Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-01-26kconfig: mconf: fix HOSTCC callEnrico Weigelt, metux IT consult1-1/+1
Commit c0f975af1745 ("kconfig: Support building mconf with vendor sysroot ncurses") introduces a bug when HOSTCC contains parameters: the whole command line is treated as the program name (with spaces in it). Therefore, we have to remove the quotes. Fixes: c0f975af1745 ("kconfig: Support building mconf with vendor sysroot ncurses") Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>