<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/scripts/kconfig/menu.c, branch v6.1.168</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-07-25T07:49:11+00:00</updated>
<entry>
<title>kconfig: remove wrong expr_trans_bool()</title>
<updated>2024-07-25T07:49:11+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2024-06-03T16:19:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5e6d87eabffe7c5cbff19f716cd88acc83e815de'/>
<id>urn:sha1:5e6d87eabffe7c5cbff19f716cd88acc83e815de</id>
<content type='text'>
[ Upstream commit 77a92660d8fe8d29503fae768d9f5eb529c88b36 ]

expr_trans_bool() performs an incorrect transformation.

[Test Code]

    config MODULES
            def_bool y
            modules

    config A
            def_bool y
            select C if B != n

    config B
            def_tristate m

    config C
            tristate

[Result]

    CONFIG_MODULES=y
    CONFIG_A=y
    CONFIG_B=m
    CONFIG_C=m

This output is incorrect because CONFIG_C=y is expected.

Documentation/kbuild/kconfig-language.rst clearly explains the function
of the '!=' operator:

    If the values of both symbols are equal, it returns 'n',
    otherwise 'y'.

Therefore, the statement:

    select C if B != n

should be equivalent to:

    select C if y

Or, more simply:

    select C

Hence, the symbol C should be selected by the value of A, which is 'y'.

However, expr_trans_bool() wrongly transforms it to:

    select C if B

Therefore, the symbol C is selected by (A &amp;&amp; B), which is 'm'.

The comment block of expr_trans_bool() correctly explains its intention:

  * bool FOO!=n =&gt; FOO
    ^^^^

If FOO is bool, FOO!=n can be simplified into FOO. This is correct.

However, the actual code performs this transformation when FOO is
tristate:

    if (e-&gt;left.sym-&gt;type == S_TRISTATE) {
                             ^^^^^^^^^^

While it can be fixed to S_BOOLEAN, there is no point in doing so
because expr_tranform() already transforms FOO!=n to FOO when FOO is
bool. (see the "case E_UNEQUAL" part)

expr_trans_bool() is wrong and unnecessary.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Acked-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>kconfig: fix segmentation fault in menuconfig search</title>
<updated>2022-11-02T08:32:05+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2022-10-23T19:10:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7a263a0402561035199cd9049baadb908a92b6b4'/>
<id>urn:sha1:7a263a0402561035199cd9049baadb908a92b6b4</id>
<content type='text'>
Since commit d05377e184fc ("kconfig: Create links to main menu items
in search"), menuconfig shows a jump key next to "Main menu" if the
nearest visible parent is the rootmenu. If you press that jump key,
menuconfig crashes with a segmentation fault.

For example, do this:

  $ make ARCH=arm64 allnoconfig menuconfig

Press '/' to search for the string "ACPI". Press '1' to choose
"(1) Main menu". Then, menuconfig crashed with a segmentation fault.

The following code in search_conf()

    conf(targets[i]-&gt;parent, targets[i]);

results in NULL pointer dereference because targets[i] is the rootmenu,
which does not have a parent.

Commit d05377e184fc tried to fix the issue of top-level items not having
a jump key, but adding the "Main menu" was not the right fix.

The correct fix is to show the searched item itself. This fixes another
weird behavior described in the comment block.

Fixes: d05377e184fc ("kconfig: Create links to main menu items in search")
Reported-by: Johannes Zink &lt;j.zink@pengutronix.de&gt;
Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
Tested-by: Bagas Sanjaya &lt;bagasdotme@gmail.com&gt;
Tested-by: Johannes Zink &lt;j.zink@pengutronix.de&gt;
</content>
</entry>
<entry>
<title>Kconfig: remove unused function 'menu_get_root_menu'</title>
<updated>2022-09-23T19:30:30+00:00</updated>
<author>
<name>Zeng Heng</name>
<email>zengheng4@huawei.com</email>
</author>
<published>2022-09-12T09:48:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=03764b30a4f0185a97515d616e60e2e00c558583'/>
<id>urn:sha1:03764b30a4f0185a97515d616e60e2e00c558583</id>
<content type='text'>
There is nowhere calling `menu_get_root_menu` function,
so remove it.

Signed-off-by: Zeng Heng &lt;zengheng4@huawei.com&gt;
Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>kconfig: Create links to main menu items in search</title>
<updated>2021-09-25T07:15:48+00:00</updated>
<author>
<name>Ariel Marcovitch</name>
<email>arielmarcovitch@gmail.com</email>
</author>
<published>2021-09-13T16:45:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d05377e184fc88e965e20606da93387b8fadf493'/>
<id>urn:sha1:d05377e184fc88e965e20606da93387b8fadf493</id>
<content type='text'>
When one searches for a main menu item, links aren't created for it like
with the rest of the symbols.

This happens because we trace the item until we get to the rootmenu, but
we don't include it in the path of the item. The rationale was probably
that we don't want to show the main menu in the path of all items,
because it is redundant.

However, when an item has only the rootmenu in its path it should be
included, because this way the user can jump to its location.

Add a 'Main menu' entry in the 'Location:' section for the kconfig
items.

This makes the 'if (i &gt; 0)' superfluous because each item with prompt
will have at least one menu in its path.

Signed-off-by: Ariel Marcovitch &lt;arielmarcovitch@gmail.com&gt;
Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>kconfig: split menu.c out of parser.y</title>
<updated>2021-04-14T06:26:09+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2021-04-13T15:08:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a77a05dc9cf24a8c88b9d9c70e8984f936d075f3'/>
<id>urn:sha1:a77a05dc9cf24a8c88b9d9c70e8984f936d075f3</id>
<content type='text'>
Compile menu.c as an independent compilation unit.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>kconfig: change "modules" from sub-option to first-level attribute</title>
<updated>2021-04-14T06:22:49+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2021-03-13T19:48:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6dd85ff178cd76851e2184b13e545f5a88d1be30'/>
<id>urn:sha1:6dd85ff178cd76851e2184b13e545f5a88d1be30</id>
<content type='text'>
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 &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>kconfig: remove allnoconfig_y option</title>
<updated>2021-04-14T06:22:49+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2021-03-13T19:48:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ab838577aaaeda12242b7f1e2da3f25c9b4cec3a'/>
<id>urn:sha1:ab838577aaaeda12242b7f1e2da3f25c9b4cec3a</id>
<content type='text'>
Now that the only user, CONFIG_EMBEDDED has stopped using this option,
remove it entirely.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>kconfig: change defconfig_list option to environment variable</title>
<updated>2021-04-14T06:22:48+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2021-03-13T19:48:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b75b0a819af9f78fc395b189cddd40f590194d20'/>
<id>urn:sha1:b75b0a819af9f78fc395b189cddd40f590194d20</id>
<content type='text'>
"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 &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>kconfig: do not assign a variable in the return statement</title>
<updated>2020-05-12T04:28:30+00:00</updated>
<author>
<name>Masahiro Yamada</name>
<email>masahiroy@kernel.org</email>
</author>
<published>2020-04-13T15:35:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=644a4b6cecc2ae3a8a840bb3606edd99af94e972'/>
<id>urn:sha1:644a4b6cecc2ae3a8a840bb3606edd99af94e972</id>
<content type='text'>
I am not a big fan of doing assignment in a return statement.
Split it into two lines.

Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
<entry>
<title>kconfig: fix nesting of symbol help text</title>
<updated>2020-01-06T17:18:45+00:00</updated>
<author>
<name>Thomas Hebb</name>
<email>tommyhebb@gmail.com</email>
</author>
<published>2019-12-17T16:15:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a9609686042b887baa636c77646b7614074c180a'/>
<id>urn:sha1:a9609686042b887baa636c77646b7614074c180a</id>
<content type='text'>
When we generate the help text of a symbol (e.g. when a user presses '?'
in menuconfig), we do two things:

 1. We iterate through every prompt that belongs to that symbol,
    printing its text and its location in the menu tree.
 2. We print symbol-wide information that's not linked to a particular
    prompt, such as what it selects/is selected by and what it
    implies/is implied by.

Each prompt we print for 1 starts with a line that's not indented
indicating where the prompt is defined, then continues with indented
lines that describe properties of that particular definition.

Once we get to 2, however, we print all the global data indented as
well! Visually, this makes it look like the symbol-wide data is
associated with the last prompt we happened to print rather than
the symbol as a whole.

Fix this by removing the indentation for symbol-wide information.

Before:

  Symbol: CPU_FREQ [=n]
  Type  : bool
  Defined at drivers/cpufreq/Kconfig:4
    Prompt: CPU Frequency scaling
    Location:
      -&gt; CPU Power Management
        -&gt; CPU Frequency scaling
    Selects: SRCU [=n]
    Selected by [n]:
    - ARCH_SA1100 [=n] &amp;&amp; &lt;choice&gt;

After:

  Symbol: CPU_FREQ [=n]
  Type  : bool
  Defined at drivers/cpufreq/Kconfig:4
    Prompt: CPU Frequency scaling
    Location:
      -&gt; CPU Power Management
        -&gt; CPU Frequency scaling
  Selects: SRCU [=n]
  Selected by [n]:
    - ARCH_SA1100 [=n] &amp;&amp; &lt;choice&gt;

Signed-off-by: Thomas Hebb &lt;tommyhebb@gmail.com&gt;
Signed-off-by: Masahiro Yamada &lt;masahiroy@kernel.org&gt;
</content>
</entry>
</feed>
