Re: [PATCH 1/1] kconfig: Terminate menu blocks with a newline in the generated config

From: Kees Cook
Date: Fri Apr 19 2019 - 15:13:25 EST


On Fri, Apr 19, 2019 at 5:29 AM Alexander Popov <alex.popov@xxxxxxxxx> 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@xxxxxxxxx>

Seems fine to improve readability at a few bytes size increase.

Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>

-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