|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2, v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7 |
|
| #
a16219bd |
| 08-Sep-2024 |
Masahiro Yamada <[email protected]> |
scripts: move hash function from scripts/kconfig/ to scripts/include/
This function was originally added by commit 8af27e1dc4e4 ("fixdep: use hash table instead of a single array").
Move it to scri
scripts: move hash function from scripts/kconfig/ to scripts/include/
This function was originally added by commit 8af27e1dc4e4 ("fixdep: use hash table instead of a single array").
Move it to scripts/include/ so that other host programs can use it.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.11-rc6, v6.11-rc5, v6.11-rc4 |
|
| #
a9d83d74 |
| 12-Aug-2024 |
Masahiro Yamada <[email protected]> |
kbuild: split x*alloc() functions in kconfig to scripts/include/xalloc.h
These functions will be useful for other host programs.
Signed-off-by: Masahiro Yamada <[email protected]>
|
|
Revision tags: v6.11-rc3, v6.11-rc2, v6.11-rc1, v6.10, v6.10-rc7 |
|
| #
94a4b0a4 |
| 07-Jul-2024 |
Masahiro Yamada <[email protected]> |
kconfig: remove SYMBOL_CHOICEVAL flag
This flag is unneeded because a choice member can be detected by other means.
Signed-off-by: Masahiro Yamada <[email protected]>
|
| #
6425e3b2 |
| 07-Jul-2024 |
Masahiro Yamada <[email protected]> |
kconfig: add const qualifiers to several function arguments
Clarify that the given structures are not modified.
Signed-off-by: Masahiro Yamada <[email protected]>
|
|
Revision tags: v6.10-rc6, v6.10-rc5 |
|
| #
e8fcd915 |
| 18-Jun-2024 |
Masahiro Yamada <[email protected]> |
kconfig: change sym_choice_default() to take the choice menu
Change the argument of sym_choice_default() to ease further cleanups.
Signed-off-by: Masahiro Yamada <[email protected]>
|
| #
bd0db4b6 |
| 18-Jun-2024 |
Masahiro Yamada <[email protected]> |
kconfig: remove sym_get_choice_value()
sym_get_choice_value(menu->sym) is equivalent to sym_calc_choice(menu).
Convert all call sites of sym_get_choice_value() and then remove it.
Signed-off-by: M
kconfig: remove sym_get_choice_value()
sym_get_choice_value(menu->sym) is equivalent to sym_calc_choice(menu).
Convert all call sites of sym_get_choice_value() and then remove it.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
f79dc03f |
| 18-Jun-2024 |
Masahiro Yamada <[email protected]> |
kconfig: refactor choice value calculation
Handling choices has always been in a PITA in Kconfig.
For example, fixes and reverts were repeated for randconfig with KCONFIG_ALLCONFIG:
- 422c809f03f
kconfig: refactor choice value calculation
Handling choices has always been in a PITA in Kconfig.
For example, fixes and reverts were repeated for randconfig with KCONFIG_ALLCONFIG:
- 422c809f03f0 ("kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG") - 23a5dfdad22a ("Revert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG"") - 8357b48549e1 ("kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG") - 490f16171119 ("Revert "kconfig: fix randomising choice entries in presence of KCONFIG_ALLCONFIG"")
As these commits pointed out, randconfig does not randomize choices when KCONFIG_ALLCONFIG is used. This issue still remains.
[Test Case]
choice prompt "choose"
config A bool "A"
config B bool "B"
endchoice
$ echo > all.config $ make KCONFIG_ALLCONFIG=1 randconfig
The output is always as follows:
CONFIG_A=y # CONFIG_B is not set
Not only randconfig, but other all*config variants are also broken with KCONFIG_ALLCONFIG.
With the same Kconfig,
$ echo '# CONFIG_A is not set' > all.config $ make KCONFIG_ALLCONFIG=1 allyesconfig
You will get this:
CONFIG_A=y # CONFIG_B is not set
This is incorrect because it does not respect all.config.
The correct output should be:
# CONFIG_A is not set CONFIG_B=y
To handle user inputs more accurately, this commit refactors the code based on the following principles:
- When a user value is given, Kconfig must set it immediately. Do not defer it by setting SYMBOL_NEED_SET_CHOICE_VALUES.
- The SYMBOL_DEF_USER flag must not be cleared, unless a new config file is loaded. Kconfig must not forget user inputs.
In addition, user values for choices must be managed with priority. If user inputs conflict within a choice block, the newest value wins. The values given by randconfig have lower priority than explicit user inputs.
This commit implements it by using a linked list. Every time a choice block gets a new input, it is moved to the top of the list.
Let me explain how it works.
Let's say, we have a choice block that consists of five symbols: A, B, C, D, and E.
Initially, the linked list looks like this:
A(=?) --> B(=?) --> C(=?) --> D(=?) --> E(=?)
Suppose randconfig is executed with the following KCONFIG_ALLCONFIG:
CONFIG_C=y # CONFIG_A is not set CONFIG_D=y
First, CONFIG_C=y is read. C is set to 'y' and moved to the top.
C(=y) --> A(=?) --> B(=?) --> D(=?) --> E(=?)
Next, '# CONFIG_A is not set' is read. A is set to 'n' and moved to the top.
A(=n) --> C(=y) --> B(=?) --> D(=?) --> E(=?)
Then, 'CONFIG_D=y' is read. D is set to 'y' and moved to the top.
D(=y) --> A(=n) --> C(=y) --> B(=?) --> E(=?)
Lastly, randconfig shuffles the order of the remaining symbols, resulting in:
D(=y) --> A(=n) --> C(=y) --> B(=y) --> E(=y) or D(=y) --> A(=n) --> C(=y) --> E(=y) --> B(=y)
When calculating the output, the linked list is traversed and the first visible symbol with 'y' is taken. In this case, it is D if visible.
If D is hidden by 'depends on', the next node, A, is examined. Since it is already specified as 'n', it is skipped. Next, C is checked, and selected if it is visible.
If C is also invisible, either B or E is chosen as a result of the randomization.
If B and E are also invisible, the linked list is traversed in the reverse order, and the least prioritized 'n' symbol is chosen. It is A in this case.
Now, Kconfig remembers all user values. This is a big difference from the previous implementation, where Kconfig would forget CONFIG_C=y when CONFIG_D=y appeared in the same input file.
The new appaorch respects user-specified values as much as possible.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.10-rc4, v6.10-rc3, v6.10-rc2, v6.10-rc1, v6.9, v6.9-rc7, v6.9-rc6 |
|
| #
6a121588 |
| 22-Apr-2024 |
Masahiro Yamada <[email protected]> |
kconfig: remove 'optional' property support
The 'choice' statement is primarily used to exclusively select one option, but the 'optional' property allows all entries to be disabled.
In the followin
kconfig: remove 'optional' property support
The 'choice' statement is primarily used to exclusively select one option, but the 'optional' property allows all entries to be disabled.
In the following example, both A and B can be disabled simultaneously:
choice prompt "choose A, B, or nothing" optional
config A bool "A"
config B bool "B"
endchoice
You can achieve the equivalent outcome by other means.
A common solution is to add another option to guard the choice block. In the following example, you can set ENABLE_A_B_CHOICE=n to disable the entire choice block:
choice prompt "choose A or B" depends on ENABLE_A_B_CHOICE
config A bool "A"
config B bool "B"
endchoice
Another approach is to insert one more entry:
choice prompt "choose A, B, or disable both"
config A bool "A"
config B bool "B"
config DISABLE_A_AND_B bool "choose this to disable both A and B"
endchoice
Some real examples are DEBUG_INFO_NONE, INITRAMFS_COMPRESSION_NONE, LTO_NONE, etc.
The 'optional' property is even more unnecessary for a tristate choice.
Without the 'optional' property, you can disable A and B; you can set 'm' in the choice prompt, and disable A and B individually:
choice prompt "choose one built-in or make them modular"
config A tristate "A"
config B tristate "B"
endchoice
In conclusion, the 'optional' property was unneeded.
Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nicolas Schier <[email protected]>
show more ...
|
| #
1da251c6 |
| 22-Apr-2024 |
Masahiro Yamada <[email protected]> |
kconfig: remove SYMBOL_CHOICE flag
All symbols except choices have a name.
Previously, choices were allowed to have a name, but commit c83f020973bc ("kconfig: remove named choice support") eliminat
kconfig: remove SYMBOL_CHOICE flag
All symbols except choices have a name.
Previously, choices were allowed to have a name, but commit c83f020973bc ("kconfig: remove named choice support") eliminated that possibility.
Now, it is easy to distinguish choices from normal symbols; if the name is NULL, it is a choice.
Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nicolas Schier <[email protected]>
show more ...
|
|
Revision tags: v6.9-rc5 |
|
| #
7284b4fb |
| 21-Apr-2024 |
Masahiro Yamada <[email protected]> |
kconfig: add menu_next() function and menu_for_each(_sub)_entry macros
Several functions require traversing menu entries sequentially. This commit introduces some helpers to simplify such operations
kconfig: add menu_next() function and menu_for_each(_sub)_entry macros
Several functions require traversing menu entries sequentially. This commit introduces some helpers to simplify such operations.
The menu_next() function facilitates depth-first traversal:
1. Descend to the child level if the current menu has one 2. Move to the next sibling at the same level if available 3. Ascend to the parent level if there is no more child or sibling
The menu_for_each_sub_entry() macro iterates over all submenu entries using depth-first traverse.
The menu_for_each_entry() macro is the same, but over all menu entries.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.9-rc4, v6.9-rc3, v6.9-rc2, v6.9-rc1 |
|
| #
7e3465f6 |
| 23-Mar-2024 |
Masahiro Yamada <[email protected]> |
kconfig: do not reparent the menu inside a choice block
The boolean 'choice' is used to list exclusively selected config options.
You must not add a dependency between choice members, because such
kconfig: do not reparent the menu inside a choice block
The boolean 'choice' is used to list exclusively selected config options.
You must not add a dependency between choice members, because such a dependency would create an invisible entry.
In the following test case, it is impossible to choose 'C'.
[Test Case 1]
choice prompt "Choose one, but how to choose C?"
config A bool "A"
config B bool "B"
config C bool "C" depends on A
endchoice
Hence, Kconfig shows the following error message:
Kconfig:1:error: recursive dependency detected! Kconfig:1: choice <choice> contains symbol C Kconfig:10: symbol C is part of choice A Kconfig:4: symbol A is part of choice <choice> For a resolution refer to Documentation/kbuild/kconfig-language.rst subsection "Kconfig recursive dependency limitations"
However, Kconfig does not report anything for the following similar code:
[Test Case 2]
choice prompt "Choose one, but how to choose B?"
config A bool "A"
config B bool "B" depends on A
config C bool "C"
endchoice
This is because menu_finalize() reparents the menu tree when an entry depends on the preceding one.
With reparenting, the menu tree:
choice |- A |- B \- C
... will be transformed into the following structure:
choice |- A | \- B \- C
Consequently, Kconfig considers only 'A' and 'C' as choice members. This behavior is awkward. The second test case should be an error too.
This commit stops reparenting inside a choice.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.8, v6.8-rc7, v6.8-rc6, v6.8-rc5, v6.8-rc4, v6.8-rc3 |
|
| #
7c4aa901 |
| 02-Feb-2024 |
Masahiro Yamada <[email protected]> |
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 locati
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 <[email protected]>
show more ...
|
| #
5b058034 |
| 02-Feb-2024 |
Masahiro Yamada <[email protected]> |
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.
T
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 <[email protected]>
show more ...
|
| #
1d7c4f10 |
| 02-Feb-2024 |
Masahiro Yamada <[email protected]> |
kconfig: remove zconf_curname() and zconf_lineno()
Now zconf_curname() and zconf_lineno() are so simple that they just return cur_filename, cur_lineno, respectively.
Remove these functions, and the
kconfig: remove zconf_curname() and zconf_lineno()
Now zconf_curname() and zconf_lineno() are so simple that they just return cur_filename, cur_lineno, respectively.
Remove these functions, and then use cur_filename and cur_lineno directly.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
526396b7 |
| 02-Feb-2024 |
Masahiro Yamada <[email protected]> |
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 othe
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 <[email protected]>
show more ...
|
|
Revision tags: v6.8-rc2, v6.8-rc1, v6.7, v6.7-rc8, v6.7-rc7, v6.7-rc6, v6.7-rc5 |
|
| #
092e39d1 |
| 03-Dec-2023 |
Masahiro Yamada <[email protected]> |
kconfig: squash menu_has_help() and menu_get_help()
menu_has_help() and menu_get_help() functions are only used within menu_get_ext_help().
Squash them into menu_get_ext_help(). It revealed the if-
kconfig: squash menu_has_help() and menu_get_help()
menu_has_help() and menu_get_help() functions are only used within menu_get_ext_help().
Squash them into menu_get_ext_help(). It revealed the if-conditional in menu_get_help() was unneeded, as menu_has_help() has already checked that menu->help is not NULL.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.7-rc4, v6.7-rc3, v6.7-rc2, v6.7-rc1, v6.6, v6.6-rc7, v6.6-rc6, v6.6-rc5, v6.6-rc4, v6.6-rc3, v6.6-rc2, v6.6-rc1, v6.5, v6.5-rc7, v6.5-rc6, v6.5-rc5, v6.5-rc4, v6.5-rc3, v6.5-rc2 |
|
| #
e14f1242 |
| 16-Jul-2023 |
Masahiro Yamada <[email protected]> |
kconfig: menuconfig: simplify global jump key assignment
Commit 95ac9b3b585d ("menuconfig: Assign jump keys per-page instead of globally") injected a lot of hacks to the bottom of the textbox infras
kconfig: menuconfig: simplify global jump key assignment
Commit 95ac9b3b585d ("menuconfig: Assign jump keys per-page instead of globally") injected a lot of hacks to the bottom of the textbox infrastructure.
I reverted many of them without changing the behavior. (almost) Now, the key markers are inserted when constructing the search result instead of updating the text buffer on-the-fly.
The buffer passed to the textbox got back to a constant string. The ugly casts from (const char *) to (char *) went away.
A disadvantage is that the same key numbers might be displayed multiple times in the dialog if you use a huge window (but I believe it is unlikely to happen).
Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Jesse Taube <[email protected]>
show more ...
|
|
Revision tags: v6.5-rc1, v6.4, v6.4-rc7, v6.4-rc6, v6.4-rc5, v6.4-rc4, v6.4-rc3, v6.4-rc2, v6.4-rc1, v6.3, v6.3-rc7, v6.3-rc6, v6.3-rc5, v6.3-rc4, v6.3-rc3, v6.3-rc2, v6.3-rc1, v6.2, v6.2-rc8, v6.2-rc7, v6.2-rc6, v6.2-rc5, v6.2-rc4, v6.2-rc3, v6.2-rc2, v6.2-rc1, v6.1, v6.1-rc8, v6.1-rc7, v6.1-rc6, v6.1-rc5 |
|
| #
4d980fd1 |
| 13-Nov-2022 |
Masahiro Yamada <[email protected]> |
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.
Sig
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 <[email protected]>
show more ...
|
|
Revision tags: v6.1-rc4, v6.1-rc3, v6.1-rc2, v6.1-rc1, v6.0, v6.0-rc7, v6.0-rc6 |
|
| #
efc8338e |
| 14-Sep-2022 |
Zeng Heng <[email protected]> |
Kconfig: remove sym_set_choice_value
sym_set_choice_value could be removed and directly call sym_set_tristate_value instead.
Signed-off-by: Zeng Heng <[email protected]> Suggested-by: Masahiro Y
Kconfig: remove sym_set_choice_value
sym_set_choice_value could be removed and directly call sym_set_tristate_value instead.
Signed-off-by: Zeng Heng <[email protected]> Suggested-by: Masahiro Yamada <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
03764b30 |
| 12-Sep-2022 |
Zeng Heng <[email protected]> |
Kconfig: remove unused function 'menu_get_root_menu'
There is nowhere calling `menu_get_root_menu` function, so remove it.
Signed-off-by: Zeng Heng <[email protected]> Signed-off-by: Masahiro Ya
Kconfig: remove unused function 'menu_get_root_menu'
There is nowhere calling `menu_get_root_menu` function, so remove it.
Signed-off-by: Zeng Heng <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.0-rc5, v6.0-rc4, v6.0-rc3, v6.0-rc2, v6.0-rc1, v5.19, v5.19-rc8, v5.19-rc7, v5.19-rc6, v5.19-rc5, v5.19-rc4, v5.19-rc3, v5.19-rc2, v5.19-rc1, v5.18, v5.18-rc7, v5.18-rc6, v5.18-rc5, v5.18-rc4, v5.18-rc3, v5.18-rc2, v5.18-rc1, v5.17, v5.17-rc8, v5.17-rc7, v5.17-rc6, v5.17-rc5, v5.17-rc4, v5.17-rc3, v5.17-rc2, v5.17-rc1, v5.16, v5.16-rc8, v5.16-rc7, v5.16-rc6, v5.16-rc5, v5.16-rc4, v5.16-rc3, v5.16-rc2, v5.16-rc1, v5.15, v5.15-rc7, v5.15-rc6, v5.15-rc5, v5.15-rc4, v5.15-rc3, v5.15-rc2, v5.15-rc1, v5.14, v5.14-rc7, v5.14-rc6, v5.14-rc5, v5.14-rc4, v5.14-rc3, v5.14-rc2, v5.14-rc1, v5.13, v5.13-rc7, v5.13-rc6, v5.13-rc5, v5.13-rc4, v5.13-rc3, v5.13-rc2, v5.13-rc1, v5.12, v5.12-rc8 |
|
| #
989e5d4b |
| 17-Apr-2021 |
Masahiro Yamada <[email protected]> |
kconfig: remove unused PACKAGE definition
Commit 3b9fa0931dd8 ("[PATCH] Kconfig i18n support") added this code, and then commit ("kconfig: drop localization support") removed the i18n support entire
kconfig: remove unused PACKAGE definition
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 <[email protected]>
show more ...
|
|
Revision tags: v5.12-rc7 |
|
| #
5ee54659 |
| 10-Apr-2021 |
Masahiro Yamada <[email protected]> |
kconfig: change sym_change_count to a boolean flag
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).
kconfig: change sym_change_count to a boolean flag
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 <[email protected]>
show more ...
|
|
Revision tags: v5.12-rc6, v5.12-rc5, v5.12-rc4, v5.12-rc3 |
|
| #
6dd85ff1 |
| 13-Mar-2021 |
Masahiro Yamada <[email protected]> |
kconfig: change "modules" from sub-option to first-level attribute
Now "modules" is the only member of the "option" property.
Remove "option", and move "modules" to the top level property.
Signed-
kconfig: change "modules" from sub-option to first-level attribute
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 <[email protected]>
show more ...
|
| #
ab838577 |
| 13-Mar-2021 |
Masahiro Yamada <[email protected]> |
kconfig: remove allnoconfig_y option
Now that the only user, CONFIG_EMBEDDED has stopped using this option, remove it entirely.
Signed-off-by: Masahiro Yamada <[email protected]>
|
| #
b75b0a81 |
| 13-Mar-2021 |
Masahiro Yamada <[email protected]> |
kconfig: change defconfig_list option to environment variable
"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
kconfig: change defconfig_list option to environment variable
"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 <[email protected]>
show more ...
|