From: Alexander Popov <alex.popov@linux.com>
To: Masahiro Yamada <yamada.masahiro@socionext.com>,
Kees Cook <keescook@chromium.org>,
Michal Marek <michal.lkml@markovi.net>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
Alexander Popov <alex.popov@linux.com>
Subject: [v2 1/1] kconfig: Terminate menu blocks with a comment in the generated config
Date: Wed, 24 Apr 2019 15:02:49 +0300 [thread overview]
Message-ID: <1556107369-7655-1-git-send-email-alex.popov@linux.com> (raw)
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 in the generated config with a comment and
a newline if needed. Example:
...
CONFIG_BPF_STREAM_PARSER=y
CONFIG_NET_FLOW_LIMIT=y
#
# Network testing
#
CONFIG_NET_PKTGEN=y
CONFIG_NET_DROP_MONITOR=y
# end of Network testing
# end of Networking options
CONFIG_HAMRADIO=y
...
Signed-off-by: Alexander Popov <alex.popov@linux.com>
---
scripts/kconfig/confdata.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 08ba146..486b4c7 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -819,6 +819,7 @@ int conf_write(const char *name)
struct menu *menu;
const char *basename;
const char *str;
+ bool need_newline = false;
char dirname[PATH_MAX+1], tmpname[PATH_MAX+22], newname[PATH_MAX+8];
char *env;
@@ -871,12 +872,16 @@ int conf_write(const char *name)
"#\n"
"# %s\n"
"#\n", str);
+ need_newline = false;
} else if (!(sym->flags & SYMBOL_CHOICE)) {
sym_calc_value(sym);
if (!(sym->flags & SYMBOL_WRITE))
goto next;
+ if (need_newline) {
+ fprintf(out, "\n");
+ need_newline = false;
+ }
sym->flags &= ~SYMBOL_WRITE;
-
conf_write_symbol(out, sym, &kconfig_printer_cb, NULL);
}
@@ -888,6 +893,11 @@ int conf_write(const char *name)
if (menu->next)
menu = menu->next;
else while ((menu = menu->parent)) {
+ if (!menu->sym && menu_is_visible(menu)) {
+ str = menu_get_prompt(menu);
+ fprintf(out, "# end of %s\n", str);
+ need_newline = true;
+ }
if (menu->next) {
menu = menu->next;
break;
--
2.7.4
next reply other threads:[~2019-04-24 12:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-24 12:02 Alexander Popov [this message]
2019-04-24 15:02 ` Kees Cook
2019-05-01 13:01 ` Alexander Popov
2019-05-07 12:29 ` Masahiro Yamada
2019-05-07 19:44 ` Alexander Popov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1556107369-7655-1-git-send-email-alex.popov@linux.com \
--to=alex.popov@linux.com \
--cc=keescook@chromium.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®