Commit graph

11 commits

Author SHA1 Message Date
Masahiro Yamada
a77a05dc9c kconfig: split menu.c out of parser.y
Compile menu.c as an independent compilation unit.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2021-04-14 15:26:09 +09:00
Masahiro Yamada
5ee5465940 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 <masahiroy@kernel.org>
2021-04-14 15:22:49 +09:00
Masahiro Yamada
6dd85ff178 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 <masahiroy@kernel.org>
2021-04-14 15:22:49 +09:00
Masahiro Yamada
ab838577aa 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 <masahiroy@kernel.org>
2021-04-14 15:22:49 +09:00
Masahiro Yamada
b75b0a819a 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 <masahiroy@kernel.org>
2021-04-14 15:22:48 +09:00
Masahiro Yamada
09d5873e4d kconfig: allow only 'config', 'comment', and 'if' inside 'choice'
The code block surrounded by 'if' ... 'endif' is reduced into if_stmt,
which is accepted in the 'choice' context. Therefore, you can write any
statements within a choice block by wrapping 'if y' ... 'end'.

For example, you can create a menu inside a choice, like follows:

---------------->8----------------
  choice
          prompt "choice"

  config A
          bool "A"

  config B
          bool "B"

  if y

  menu "strange menu"

  config C
          bool "C"

  endmenu

  endif

  endchoice
---------------->8----------------

I want to change such a weird structure into a syntax error.

In fact, the USB gadget Kconfig had used nested 'choice' for no good
reason until commit df8df5e4bc ("usb: get rid of 'choice' for
legacy gadget drivers") killed it.

I think the 'source' inside 'choice' is on the fence. It is at least
gramatically sensible as long as the included file contains only
bool/tristate configs. However, it makes the code unreadable, and people
tend to forget the fact that the file is included from the choice
block. Commit 10e5e6c249 ("usb: gadget: move choice ... endchoice to
legacy/Kconfig") got rid of the only usecase.

Going forward, you can only use 'config', 'comment', and 'if' inside
'choice'. This also recursively applies to 'if' blocks inside 'choice'.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-05-12 13:28:30 +09:00
Masahiro Yamada
6397d96ba5 kconfig: remove sym from struct property
struct property can reference to the symbol that it is associated with
by prop->menu->sym.

Fix up the one usage of prop->sym, and remove sym from struct property.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-01-07 02:18:44 +09:00
Masahiro Yamada
1be6e79138 kconfig: remove 'prompt' symbol
Now that 'prompt' is only reduced from T_WORD_QUOTE without any action,
use T_WORD_QUOTE directly.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-01-07 02:18:44 +09:00
Masahiro Yamada
801b27db46 kconfig: drop T_WORD from the RHS of 'prompt' symbol
Commit 8636a1f967 ("treewide: surround Kconfig file paths with double
quotes") killed use-cases to reduce an unquoted string into the 'prompt'
symbol.

Kconfig still allows to use an unquoted string in the context of menu,
source, or prompt.

So, you can omit quoting if the prompt is a single word:

    bool foo

..., but I do not think this is so useful.

Let's require quoting:

    bool "foo"

All the Kconfig files in the kernel are written in this way.

Remove the T_WORD from the right-hand side of the symbol 'prompt'.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-01-07 02:18:44 +09:00
Masahiro Yamada
521b29b6ff kconfig: split util.c out of parser.y
util.c exists both in scripts/kconfig/ and scripts/kconfig/lxdialog.

Prior to commit 54b8ae66ae ("kbuild: change *FLAGS_<basetarget>.o
to take the path relative to $(obj)"), Kbuild could not pass different
flags to source files with the same basename. Now that this issue
was solved, you can split util.c out of parser.y and compile them
independently of each other.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-11-11 20:07:03 +09:00
Masahiro Yamada
769a1c0226 kconfig: rename zconf.y to parser.y
Use a more logical name.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-02-13 23:25:58 +09:00
Renamed from scripts/kconfig/zconf.y (Browse further)