kconfig: Terminate menu blocks with a newline in the generated config
PATCH 1/1 kconfig: Terminate menu blocks with a newline in the generated config
Currently menu blocks start with a pretty header but end with nothing in the generated config. So next config options stick together with the options from the menu block.
Let's terminate menu blocks with a newline in the generated config.
--- scripts/kconfig/confdata.c | 2 ++ 1 file changed, 2 insertions(+)
scripts/kconfig/confdata.c +2 -0
@@ -888,6 +888,8 @@ int conf_write(const char *name)if (menu->next) menu = menu->next;else while ((menu = menu->parent)) { +if (!menu->sym &&menu_is_visible (menu)) +fprintf (out,"\n" );if (menu->next) { menu = menu->next;break ;
Signature · 1 line
2.7.4
Quoted 8 lines · Alexander Popov
Currently menu blocks start with a pretty header but end with nothing in the generated config. So next config options stick together with the options from the menu block.
Let's terminate menu blocks with a newline in the generated config.
Signed-off-by Alexander Popov <[email protected]>
Seems fine to improve readability at a few bytes size increase.
-Kees
Quoted 20 lines
--- scripts/kconfig/confdata.c | 2 ++ 1 file changed, 2 insertions(+)scripts/kconfig/confdata.c +2
-1@@ -888,6 +888,8 @@ int conf_write(const char *name)if (menu->next) menu = menu->next;else while ((menu = menu->parent)) { +if (!menu->sym &&menu_is_visible (menu)) +fprintf (out,"\n" );if (menu->next) { menu = menu->next;break ; --2.7.4
Signature · 1 line
Kees Cook
Quoted 8 lines · Alexander Popov
Currently menu blocks start with a pretty header but end with nothing in the generated config. So next config options stick together with the options from the menu block.
Let's terminate menu blocks with a newline in the generated config.
Signed-off-by Alexander Popov <[email protected]>
The .config file is a flat list of CONFIG options. It does not represent menu structures at all.
I tested "make allyesconfig"
and the resulted outcome looks cheesy.
[1] Two blank lines in a row
---------->8-----------------CONFIG_EFI_EARLYCON=yCONFIG_IMX_SCU=yCONFIG_IMX_SCU_PD=y
#
# Tegra firmware driver
#
CONFIG_HAVE_KVM=yCONFIG_HAVE_KVM_IRQCHIP=yCONFIG_HAVE_KVM_IRQFD=y
--------->8------------------------
[2] Some blank lines appended at the end of file
----------->8-------------CONFIG_CPA_DEBUG=yCONFIG_OPTIMIZE_INLINING=yCONFIG_DEBUG_ENTRY=yCONFIG_DEBUG_NMI_SELFTEST=yCONFIG_X86_DEBUG_FPU=yCONFIG_PUNIT_ATOM_DEBUG=yCONFIG_UNWINDER_ORC=y
# CONFIG_UNWINDER_FRAME_POINTER is not set
---------->8-----------------
The readability of the .config could be improved somehow, but this patch is not the right one.
Signature · 2 lines
Best Regards Masahiro Yamada
Quoted 6 lines · Masahiro Yamada
Quoted 5 lines · Alexander Popov
Currently menu blocks start with a pretty header but end with nothing in the generated config. So next config options stick together with the options from the menu block.
Quoted 6 lines
Quoted 3 lines
Let's terminate menu blocks with a newline in the generated config.
Signed-off-by Alexander Popov <[email protected]>The readability of the .config could be improved somehow, but this patch is not the right one.
Masahiro, thanks for having a look.
I've just sent v2 which does this task much better.
Best regards,
Alexander