* [PATCH 1/1] kconfig: Terminate menu blocks with a newline in the generated config
@ 2019-04-19 10:29 Alexander Popov
2019-04-19 15:02 ` Kees Cook
2019-04-24 10:09 ` Masahiro Yamada
0 siblings, 2 replies; 4+ messages in thread
From: Alexander Popov @ 2019-04-19 10:29 UTC (permalink / raw)
To: Masahiro Yamada, Kees Cook, Michal Marek, linux-kbuild,
linux-kernel, 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 <alex.popov@linux.com>
---
scripts/kconfig/confdata.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 08ba146..1459153 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] kconfig: Terminate menu blocks with a newline in the generated config
2019-04-19 10:29 [PATCH 1/1] kconfig: Terminate menu blocks with a newline in the generated config Alexander Popov
@ 2019-04-19 15:02 ` Kees Cook
2019-04-24 10:09 ` Masahiro Yamada
1 sibling, 0 replies; 4+ messages in thread
From: Kees Cook @ 2019-04-19 15:02 UTC (permalink / raw)
To: Alexander Popov; +Cc: Masahiro Yamada, Michal Marek, linux-kbuild, LKML
On Fri, Apr 19, 2019 at 5:29 AM Alexander Popov <alex.popov@linux.com> wrote:
>
> 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 <alex.popov@linux.com>
Seems fine to improve readability at a few bytes size increase.
Reviewed-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
> scripts/kconfig/confdata.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
> index 08ba146..1459153 100644
> --- a/scripts/kconfig/confdata.c
> +++ b/scripts/kconfig/confdata.c
> @@ -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
>
--
Kees Cook
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] kconfig: Terminate menu blocks with a newline in the generated config
2019-04-19 10:29 [PATCH 1/1] kconfig: Terminate menu blocks with a newline in the generated config Alexander Popov
2019-04-19 15:02 ` Kees Cook
@ 2019-04-24 10:09 ` Masahiro Yamada
2019-04-24 12:05 ` Alexander Popov
1 sibling, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2019-04-24 10:09 UTC (permalink / raw)
To: Alexander Popov
Cc: Kees Cook, Michal Marek, Linux Kbuild mailing list,
Linux Kernel Mailing List
On Sat, Apr 20, 2019 at 4:12 AM Alexander Popov <alex.popov@linux.com> wrote:
>
> 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 <alex.popov@linux.com>
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=y
CONFIG_IMX_SCU=y
CONFIG_IMX_SCU_PD=y
#
# Tegra firmware driver
#
CONFIG_HAVE_KVM=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_IRQFD=y
--------->8------------------------
[2] Some blank lines appended at the end of file
----------->8-------------
CONFIG_CPA_DEBUG=y
CONFIG_OPTIMIZE_INLINING=y
CONFIG_DEBUG_ENTRY=y
CONFIG_DEBUG_NMI_SELFTEST=y
CONFIG_X86_DEBUG_FPU=y
CONFIG_PUNIT_ATOM_DEBUG=y
CONFIG_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.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] kconfig: Terminate menu blocks with a newline in the generated config
2019-04-24 10:09 ` Masahiro Yamada
@ 2019-04-24 12:05 ` Alexander Popov
0 siblings, 0 replies; 4+ messages in thread
From: Alexander Popov @ 2019-04-24 12:05 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Kees Cook, Michal Marek, Linux Kbuild mailing list,
Linux Kernel Mailing List
On 24.04.2019 13:09, Masahiro Yamada wrote:
> On Sat, Apr 20, 2019 at 4:12 AM Alexander Popov <alex.popov@linux.com> wrote:
>>
>> 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 <alex.popov@linux.com>
>
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-04-24 12:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-19 10:29 [PATCH 1/1] kconfig: Terminate menu blocks with a newline in the generated config Alexander Popov
2019-04-19 15:02 ` Kees Cook
2019-04-24 10:09 ` Masahiro Yamada
2019-04-24 12:05 ` Alexander Popov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).