#
980c9e19 |
|
02-Feb-2024 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: convert linked list of files to hash table Currently, a linked list is used to keep track of all the Kconfig files that have ever been parsed. Every time the "source" statement is encountered, the linked list is traversed to check if the file has been opened before. This prevents the same file from being recorded in include/config/auto.conf.cmd again. Given 1500+ Kconfig files parsed, a hashtable is now a more optimal data structure. By the way, you may wonder why we check this in the first place. It matters only when the same file is included multiple times. In old days, such a use case was forbidden, but commit f094f8a1b273 ("kconfig: allow multiple inclusion of the same file") provided a bit more flexibility. Of course, it is almost hypothetical... Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
#
7c4aa901 |
|
02-Feb-2024 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: move strhash() to util.c as a global function Remove the 'static' qualifier from strhash() so that it can be accessed from other files. Move it to util.c, which is a more appropriate location. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
#
5b058034 |
|
02-Feb-2024 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: change file_lookup() to return the file name Currently, file_lookup() returns a pointer to (struct file), but the callers use only file->name. Make it return the ->name member directly. This adjustment encapsulates struct file and file_list as internal implementation. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
#
6676c5bc |
|
02-Feb-2024 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: make file::name a flexible array member Call malloc() just once to allocate needed memory. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
#
526396b7 |
|
02-Feb-2024 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: write Kconfig files to autoconf.cmd in order Currently, include/config/autoconf.cmd saves included Kconfig files in reverse order. While this is not a big deal, it is inconsistent with other *.cmd files generated by fixdep. Output the included Kconfig files in the included order. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
#
407868de |
|
03-Dec-2023 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: remove redundant NULL pointer check before free() Passing NULL to free() is allowed and is a no-op. Remove redundant NULL pointer checks. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
#
4d980fd1 |
|
13-Nov-2022 |
Masahiro Yamada <masahiroy@kernel.org> |
kconfig: remove const qualifier from str_get() update_text() apparently edits the buffer returned by str_get(). (and there is no reason why it shouldn't) Remove 'const' quailifier and casting. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
#
0c874100 |
|
18-Dec-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
kconfig: convert to SPDX License Identifier All files in lxdialog/ are licensed under GPL-2.0+, and the rest are under GPL-2.0. I added GPL-2.0 tags to test scripts in tests/. Documentation/process/license-rules.rst does not suggest anything about the flex/bison files. Because flex does not accept the C++ comment style at the very top of a file, I used the C style for zconf.l, and so for zconf.y for consistency. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
|
#
a2ff4040 |
|
20-Jul-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
kconfig: rename file_write_dep and move it to confdata.c file_write_dep() is called only from conf_write_autoconf(). Move it from util.c to confdata.c to make it static. Also, rename it to conf_write_dep() since it should belong to the group of conf_write* functions. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
|
#
bb222cee |
|
28-May-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
kconfig: remove string expansion in file_lookup() There are two callers of file_lookup(), but there is no more reason to expand the given path. [1] zconf_initscan() This is used to open the first Kconfig. sym_expand_string_value() has never been used in a useful way here; before opening the first Kconfig file, obviously there is no symbol to expand. If you use expand_string_value() instead, environments in KBUILD_KCONFIG would be expanded, but I do not see practical benefits for that. [2] zconf_nextfile() This is used to open the next file from 'source' statement. Symbols in the path like "arch/$SRCARCH/Kconfig" needed expanding, but it was replaced with the direct environment expansion. The environment has already been expanded before the token is passed to the parser. By the way, file_lookup() was already buggy; it expanded a given path, but it used the path before expansion for look-up: if (!strcmp(name, file->name)) { Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>
|
#
104daea1 |
|
28-May-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
kconfig: reference environment variables directly and remove 'option env=' To get access to environment variables, Kconfig needs to define a symbol using "option env=" syntax. It is tedious to add a symbol entry for each environment variable given that we need to define much more such as 'CC', 'AS', 'srctree' etc. to evaluate the compiler capability in Kconfig. Adding '$' for symbol references is grammatically inconsistent. Looking at the code, the symbols prefixed with 'S' are expanded by: - conf_expand_value() This is used to expand 'arch/$ARCH/defconfig' and 'defconfig_list' - sym_expand_string_value() This is used to expand strings in 'source' and 'mainmenu' All of them are fixed values independent of user configuration. So, they can be changed into the direct expansion instead of symbols. This change makes the code much cleaner. The bounce symbols 'SRCARCH', 'ARCH', 'SUBARCH', 'KERNELVERSION' are gone. sym_init() hard-coding 'UNAME_RELEASE' is also gone. 'UNAME_RELEASE' should be replaced with an environment variable. ARCH_DEFCONFIG is a normal symbol, so it should be simply referenced without '$' prefix. The new syntax is addicted by Make. The variable reference needs parentheses, like $(FOO), but you can omit them for single-letter variables, like $F. Yet, in Makefiles, people tend to use the parenthetical form for consistency / clarification. At this moment, only the environment variable is supported, but I will extend the concept of 'variable' later on. The variables are expanded in the lexer so we can simplify the token handling on the parser side. For example, the following code works. [Example code] config MY_TOOLCHAIN_LIST string default "My tools: CC=$(CC), AS=$(AS), CPP=$(CPP)" [Result] $ make -s alldefconfig && tail -n 1 .config CONFIG_MY_TOOLCHAIN_LIST="My tools: CC=gcc, AS=as, CPP=gcc -E" Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Kees Cook <keescook@chromium.org>
|
#
cd81fc82 |
|
16-Feb-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
kconfig: add xstrdup() helper We already have xmalloc(), xcalloc(), and xrealloc((). Add xstrdup() as well to save tedious error handling. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
|
#
523ca58b |
|
08-Feb-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
kconfig: remove const qualifier from sym_expand_string_value() This function returns realloc'ed memory, so the returned pointer must be passed to free() when done. So, 'const' qualifier is odd. It is allowed to modify the expanded string. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
|
#
d717f24d |
|
08-Feb-2018 |
Masahiro Yamada <yamada.masahiro@socionext.com> |
kconfig: add xrealloc() helper We already have xmalloc(), xcalloc(). Add xrealloc() as well to save tedious error handling. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
|
#
46315744 |
|
24-Feb-2015 |
Michal Marek <mmarek@suse.cz> |
kconfig: Remove dead code Signed-off-by: Michal Marek <mmarek@suse.cz>
|
#
7eb6e340 |
|
28-May-2014 |
Masahiro Yamada <yamada.m@jp.panasonic.com> |
kbuild: trivial - remove trailing empty lines Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
|
#
177acf78 |
|
06-Nov-2012 |
Alan Cox <alan@linux.intel.com> |
kconfig: Fix malloc handling in conf tools (and get them out of the noise in the audit work) Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
|
#
02d95c96 |
|
01-Jun-2011 |
Arnaud Lacombe <lacombar@gmail.com> |
kconfig: add missing <stdlib.h> inclusion This header is needed when using {m,re}alloc(3) and free(3) function family. Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
|
#
10a4b277 |
|
01-Jun-2011 |
Arnaud Lacombe <lacombar@gmail.com> |
kconfig: add missing <stdarg.h> inclusion This header is needed when using va_{start,end,copy}(3) functions family. Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
|
#
c7abe863 |
|
04-Sep-2010 |
Arnaud Lacombe <lacombar@gmail.com> |
kconfig: expand file names This will allow to use the following construct in source files: config FOO string default "foo" source "$FOO/Kconfig" Signed-off-by: Arnaud Lacombe <lacombar@gmail.com> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Michal Marek <mmarek@suse.cz>
|
#
31a2d31d |
|
18-Feb-2010 |
Thomas Weber <weber@corscience.de> |
kconfig: util: Fix typo in comment sting replaced with string Signed-off-by: Thomas Weber <weber@corscience.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
|
#
da60fbbc |
|
20-Dec-2009 |
Vadim Bendebury (вб) <vbendeb@google.com> |
menuconfig: wrap long help lines Help text for certain config options is very extensive (the text includes the names of all other options the option in question depends on). Long lines are not wrapped, making it impossible to see the list without scrolling horizontally. This patch adds some logic which wraps help screen lines at word boundaries to prevent truncating. Tested by running ARCH=powerpc make menuconfig O=/tmp/build which shows that the long lines are now wrapped, and ARCH=powerpc make xconfig O=/tmp/build to demonstrate that it still compiles and operates as expected. Signed-off-by: Vadim Bendebury <vbendeb@google.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
|
#
12122f62 |
|
17-May-2009 |
Markus Heidelberg <markus.heidelberg@web.de> |
kconfig: do not hardcode "include/config/auto.conf" filename Regardless of KCONFIG_AUTOCONFIG, the filename written as a Make target into "include/config/auto.conf.cmd" was always the default one. Of course this doesn't make it work for the Kernel kbuild system, since there the filename is hardcoded at several places in the Makefiles. Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
#
107f43a0 |
|
18-May-2008 |
Christophe Jaillet <christophe.jaillet@wanadoo.fr> |
kconfig: incorrect 'len' field initialisation ? 1) The field 'len' of the 'gstr' structure seems to track the size of the memory already allocated for the "growable string". So the value of this field should be the same as the 'malloc()' just above, shouldn't it ? Signed-off-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
#
93449082 |
|
13-Jan-2008 |
Roman Zippel <zippel@linux-m68k.org> |
kconfig: environment symbol support Add the possibility to import a value from the environment into kconfig via the option syntax. Beside flexibility this has the advantage providing proper dependencies. Documented the options syntax. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
#
a67cb131 |
|
19-Sep-2007 |
Sam Ravnborg <sam@ravnborg.org> |
kconfig: fix segv fault in menuconfig With specific configurations requesting help for certain menu lines caused menuconfig to crash. This was tracked down to a null pointer bug. Thanks to "Miles Lane" <miles.lane@gmail.com> for inital reporting and to Gabriel C <nix.or.die@googlemail.com> for the backtrace that helped me locating the bug. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
#
c955ccaf |
|
08-Jun-2006 |
Roman Zippel <zippel@linux-m68k.org> |
kconfig: fix .config dependencies This fixes one of the worst kbuild warts left - the broken dependencies used to check and regenerate the .config file. This was done via an indirect dependency and the .config itself had an empty command, which can cause make not to reread the changed .config file. Instead of this we generate now a new file include/config/auto.conf from .config, which is used for kbuild and has the proper dependencies. It's also the main make target now for all files generated during this step (and thus replaces include/linux/autoconf.h). This also means we can now relax the syntax requirements for the .config file and we don't have to rewrite it all the time, i.e. silentoldconfig only writes .config now when it's necessary to keep it in sync with the Kconfig files and even this can be suppressed by setting the environment variable KCONFIG_NOSILENTUPDATE, so the update can (and must) be done manually. Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
#
4a4efbde |
|
03-Jan-2006 |
Matt Mackall <mpm@selenic.com> |
s/retreiv/retriev/g As everyone knows, the rule is: "i before e.. um.. always." Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Adrian Bunk <bunk@stusta.de>
|
#
752625cf |
|
26-Dec-2005 |
Sam Ravnborg <sam@mars.ravnborg.org> |
kbuild: always run 'make silentoldconfig' when tree is cleaned If the file .kconfig.d is missing then make sure to run 'make silentoldconfig', since we have no way to detect if a Kconfig file has been updated. -kconfig.d is created by kconfig and is removed as part of 'make clean' so the situation is likely to occur in reality. Jan Beulich <JBeulich@novell.com> reported this bug. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
#
1da177e4 |
|
16-Apr-2005 |
Linus Torvalds <torvalds@ppc970.osdl.org> |
Linux-2.6.12-rc2 Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
|