All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Fixes concerning zconfdump()
@ 2018-06-22 19:27 Dirk Gouders
  2018-06-22 19:27 ` [PATCH 1/3] kconfig: avoid assert()-triggered segfaults in xfwrite() Dirk Gouders
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Dirk Gouders @ 2018-06-22 19:27 UTC (permalink / raw)
  To: Masahiro Yamada, Linux Kbuild mailing list; +Cc: Dirk Gouders, Sam Ravnborg

Hi Masahiro,

this series contains two actual fixes, the third patch is rather aimed
to be an RFC.  I find it quite useful to have a target at hand to
easily generate debugging output from the parser when needed.  I could
imagine this target could also be used to add some parser tests to the
recently introduced automated tests, but perhap you already have other
plans or better suggestions.

Dirk

Dirk Gouders (3):
  kconfig: avoid assert()-triggered segfaults in xfwrite()
  kconfig: handle P_SYMBOL in print_symbol()
  kconfig: add debugconfig target for debugging purposes

 scripts/kconfig/Makefile | 10 ++++++++-
 scripts/kconfig/dconf.c  | 55 ++++++++++++++++++++++++++++++++++++++++++++++++
 scripts/kconfig/expr.c   |  5 ++++-
 scripts/kconfig/expr.h   |  3 +++
 scripts/kconfig/zconf.y  |  4 ++++
 5 files changed, 75 insertions(+), 2 deletions(-)
 create mode 100644 scripts/kconfig/dconf.c

-- 
2.13.6


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 1/3] kconfig: avoid assert()-triggered segfaults in xfwrite()
  2018-06-22 19:27 [PATCH 0/3] Fixes concerning zconfdump() Dirk Gouders
@ 2018-06-22 19:27 ` Dirk Gouders
  2018-06-27 16:29   ` Masahiro Yamada
  2018-06-22 19:27 ` [PATCH 2/3] kconfig: handle P_SYMBOL in print_symbol() Dirk Gouders
  2018-06-22 19:27 ` [PATCH 3/3] kconfig: add debugconfig target for debugging purposes Dirk Gouders
  2 siblings, 1 reply; 19+ messages in thread
From: Dirk Gouders @ 2018-06-22 19:27 UTC (permalink / raw)
  To: Masahiro Yamada, Linux Kbuild mailing list; +Cc: Dirk Gouders

xfwrite uses assert() to ensure it does not operate on empty strings.
Two users respect this, expr_print_file_helper() doesn't and causes
segfaults e.g. when the dependency for an empty default string is printed.

Fix this by calling xfwrite with an empty string pattern ("") for
empty strings.

INITRAMFS_SOURCE was one symbol that caused this problem, with this
fix applied the zconfdump() output for this symbol looks as follows:

------------------------------------------------------------------------
config INITRAMFS_SOURCE
  string
  symbol INITRAMFS_SOURCE
  prompt "Initramfs source file(s)" if BLK_DEV_INITRD
  default "" if BLK_DEV_INITRD
  help
This can be either a single cpio archive with a .cpio suffix or a
space-separated list of directories and files for building the
initramfs image.  A cpio archive should contain a filesystem archive
to be used as an initramfs image.  Directories should contain a
filesystem layout to be included in the initramfs image.  Files
should contain entries according to the format described by the
"usr/gen_init_cpio" program in the kernel tree.

When multiple directories and files are specified then the
initramfs image will be the aggregate of all of them.

See <file:Documentation/early-userspace/README> for more details.

If you are not sure, leave it blank.
------------------------------------------------------------------------

Signed-off-by: Dirk Gouders <dirk@gouders.net>
---
 scripts/kconfig/expr.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index e1a39e90841d..e064bf4c2881 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -1231,7 +1231,10 @@ void expr_print(struct expr *e,
 
 static void expr_print_file_helper(void *data, struct symbol *sym, const char *str)
 {
-	xfwrite(str, strlen(str), 1, data);
+	if (*str != '\0')
+		xfwrite(str, strlen(str), 1, data);
+	else
+		xfwrite("\"\"", 2, 1, data);
 }
 
 void expr_fprint(struct expr *e, FILE *out)
-- 
2.13.6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 2/3] kconfig: handle P_SYMBOL in print_symbol()
  2018-06-22 19:27 [PATCH 0/3] Fixes concerning zconfdump() Dirk Gouders
  2018-06-22 19:27 ` [PATCH 1/3] kconfig: avoid assert()-triggered segfaults in xfwrite() Dirk Gouders
@ 2018-06-22 19:27 ` Dirk Gouders
  2018-06-27 16:30   ` Masahiro Yamada
  2018-06-22 19:27 ` [PATCH 3/3] kconfig: add debugconfig target for debugging purposes Dirk Gouders
  2 siblings, 1 reply; 19+ messages in thread
From: Dirk Gouders @ 2018-06-22 19:27 UTC (permalink / raw)
  To: Masahiro Yamada, Linux Kbuild mailing list; +Cc: Dirk Gouders, Sam Ravnborg

Each symbol has a property of type P_SYMBOL since commit
59e89e3ddf8523be (kconfig: save location of config symbols).
Handle those properties in print_symbol().

Further, place a pointer to print_symbol() in the comment above the
list of known property type.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/kconfig/expr.h  | 3 +++
 scripts/kconfig/zconf.y | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
index 94a383b21df6..f63b41b0dd49 100644
--- a/scripts/kconfig/expr.h
+++ b/scripts/kconfig/expr.h
@@ -171,6 +171,9 @@ struct symbol {
  * config BAZ
  *         int "BAZ Value"
  *         range 1..255
+ *
+ * Please, also check zconf.y:print_symbol() when modifying the
+ * list of property types!
  */
 enum prop_type {
 	P_UNKNOWN,
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 6f9b0aa32a82..525b82c5fb58 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -717,6 +717,10 @@ static void print_symbol(FILE *out, struct menu *menu)
 			print_quoted_string(out, prop->text);
 			fputc('\n', out);
 			break;
+		case P_SYMBOL:
+			fputs( "  symbol ", out);
+			fprintf(out, "%s\n", prop->sym->name);
+			break;
 		default:
 			fprintf(out, "  unknown prop %d!\n", prop->type);
 			break;
-- 
2.13.6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 3/3] kconfig: add debugconfig target for debugging purposes
  2018-06-22 19:27 [PATCH 0/3] Fixes concerning zconfdump() Dirk Gouders
  2018-06-22 19:27 ` [PATCH 1/3] kconfig: avoid assert()-triggered segfaults in xfwrite() Dirk Gouders
  2018-06-22 19:27 ` [PATCH 2/3] kconfig: handle P_SYMBOL in print_symbol() Dirk Gouders
@ 2018-06-22 19:27 ` Dirk Gouders
  2018-07-05  9:31   ` Masahiro Yamada
  2 siblings, 1 reply; 19+ messages in thread
From: Dirk Gouders @ 2018-06-22 19:27 UTC (permalink / raw)
  To: Masahiro Yamada, Linux Kbuild mailing list; +Cc: Dirk Gouders, Sam Ravnborg

Currently, we need to modify existing kconfig targets to generate debugging
information from the parser.  That information then has to be filtered
somehow, automated tests are at least complicated to implement.

Add a debugconfig target for pure debugging purposes; the initial
version of this target dumps the menu tree and with the --debug option
activates the parsers debugging output via it's global variable
cdebug.  The environment variable ZCONF_DEBUG can be used to generate
even more detailed debugging information.

Sample output for a simple Kconfig file:

$ scripts/kconfig/dconf --debug Kconfig.dconfig
Kconfig.dconfig:1:config a
Kconfig.dconfig:2:type(1)
Kconfig.dconfig:4:endconfig
Kconfig.dconfig:5:if
Kconfig.dconfig:5:config b
Kconfig.dconfig:6:type(1)
Kconfig.dconfig:7:endconfig
Kconfig.dconfig:7:endif

config a
  bool
  symbol a
  prompt "a"

config b
  bool
  symbol b
  prompt "b" if a

endmenu

Signed-off-by: Dirk Gouders <dirk@gouders.net>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/kconfig/Makefile | 10 ++++++++-
 scripts/kconfig/dconf.c  | 55 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+), 1 deletion(-)
 create mode 100644 scripts/kconfig/dconf.c

diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index a3ac2c91331c..19906ff25392 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -4,7 +4,7 @@
 # These targets are used from top-level makefile
 
 PHONY += xconfig gconfig menuconfig config syncconfig \
-	localmodconfig localyesconfig
+	localmodconfig localyesconfig debugconfig
 
 ifdef KBUILD_KCONFIG
 Kconfig := $(KBUILD_KCONFIG)
@@ -34,6 +34,9 @@ config: $(obj)/conf
 nconfig: $(obj)/nconf
 	$< $(silent) $(Kconfig)
 
+debugconfig: $(obj)/dconf
+	$< $(silent) $(Kconfig)
+
 # This has become an internal implementation detail and is now deprecated
 # for external use.
 syncconfig: $(obj)/conf
@@ -149,6 +152,7 @@ help:
 	@echo  '  xenconfig       - Enable additional options for xen dom0 and guest kernel support'
 	@echo  '  tinyconfig	  - Configure the tiniest possible kernel'
 	@echo  '  testconfig	  - Run Kconfig unit tests (requires python3 and pytest)'
+	@echo  '  debugconfig	  - Debugging tool for developers'
 
 # ===========================================================================
 # Shared Makefile for the various kconfig executables:
@@ -165,6 +169,10 @@ targets		+= zconf.lex.c
 HOSTCFLAGS_zconf.lex.o	:= -I$(src)
 HOSTCFLAGS_zconf.tab.o	:= -I$(src)
 
+# dconf: Used for kconfig debugging
+hostprogs-y	+= dconf
+dconf-objs	:= dconf.o zconf.tab.o
+
 # nconf: Used for the nconfig target based on ncurses
 hostprogs-y	+= nconf
 nconf-objs	:= nconf.o zconf.tab.o nconf.gui.o
diff --git a/scripts/kconfig/dconf.c b/scripts/kconfig/dconf.c
new file mode 100644
index 000000000000..ed1edf607d80
--- /dev/null
+++ b/scripts/kconfig/dconf.c
@@ -0,0 +1,55 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Copyright (C) 2018 Dirk Gouders <dirk@gouders.net>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <getopt.h>
+
+#include "lkc.h"
+
+extern int cdebug;
+
+void usage(const char *progname);
+void usage(const char *progname)
+{
+	printf("Usage: %s --help | [--debug] <kconfig-file>\n", progname);
+}
+
+int main(int argc, char *argv[])
+{
+	int c;
+	int opt_index = 0;
+	char *filename;
+
+	struct option long_opts[] = {
+		{"debug", no_argument, NULL, 0},
+		{"help", no_argument, NULL, 1},
+		{0, 0, 0, 0}
+	};
+
+	while (1 ) {
+		c = getopt_long(argc, argv, "", long_opts, &opt_index);
+
+		if (c == -1)
+			break;
+		if (c == 0) {
+			cdebug = 0x02;
+		}
+		if (c == 1) {
+			usage(argv[0]);
+			exit(EXIT_SUCCESS);
+		}
+	}
+
+	if (optind == argc) {
+		usage(argv[0]);
+		exit(EXIT_FAILURE);
+	} else
+		filename = argv[optind];
+
+	conf_parse(filename);
+	zconfdump(stdout);
+
+	exit(EXIT_SUCCESS);
+}
-- 
2.13.6


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/3] kconfig: avoid assert()-triggered segfaults in xfwrite()
  2018-06-22 19:27 ` [PATCH 1/3] kconfig: avoid assert()-triggered segfaults in xfwrite() Dirk Gouders
@ 2018-06-27 16:29   ` Masahiro Yamada
  2018-06-27 19:23     ` Dirk Gouders
  0 siblings, 1 reply; 19+ messages in thread
From: Masahiro Yamada @ 2018-06-27 16:29 UTC (permalink / raw)
  To: Dirk Gouders; +Cc: Linux Kbuild mailing list

2018-06-23 4:27 GMT+09:00 Dirk Gouders <dirk@gouders.net>:
> xfwrite uses assert() to ensure it does not operate on empty strings.
> Two users respect this, expr_print_file_helper() doesn't and causes
> segfaults e.g. when the dependency for an empty default string is printed.
>
> Fix this by calling xfwrite with an empty string pattern ("") for
> empty strings.
>
> INITRAMFS_SOURCE was one symbol that caused this problem, with this
> fix applied the zconfdump() output for this symbol looks as follows:
>
> ------------------------------------------------------------------------
> config INITRAMFS_SOURCE
>   string
>   symbol INITRAMFS_SOURCE
>   prompt "Initramfs source file(s)" if BLK_DEV_INITRD
>   default "" if BLK_DEV_INITRD
>   help
> This can be either a single cpio archive with a .cpio suffix or a
> space-separated list of directories and files for building the
> initramfs image.  A cpio archive should contain a filesystem archive
> to be used as an initramfs image.  Directories should contain a
> filesystem layout to be included in the initramfs image.  Files
> should contain entries according to the format described by the
> "usr/gen_init_cpio" program in the kernel tree.
>
> When multiple directories and files are specified then the
> initramfs image will be the aggregate of all of them.
>
> See <file:Documentation/early-userspace/README> for more details.
>
> If you are not sure, leave it blank.
> ------------------------------------------------------------------------
>
> Signed-off-by: Dirk Gouders <dirk@gouders.net>
> ---


Hmm, please let me think about this.

I know this is an easy way to fix the seg-fault,
but I think it is not a correct way.



If the config entry were like this:

config INITRAMFS_SOURCE
        string "Initramfs source file(s)"
        default "foo"



It would be dumped like this:

config INITRAMFS_SOURCE
  string
  symbol INITRAMFS_SOURCE
  prompt "Initramfs source file(s)"
  default foo




I want it to be displayed like this:

   default "foo"


If we can quote the string values,
the problem will be eventually fixed.

It may not be easy to fix it...




>  scripts/kconfig/expr.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
> index e1a39e90841d..e064bf4c2881 100644
> --- a/scripts/kconfig/expr.c
> +++ b/scripts/kconfig/expr.c
> @@ -1231,7 +1231,10 @@ void expr_print(struct expr *e,
>
>  static void expr_print_file_helper(void *data, struct symbol *sym, const char *str)
>  {
> -       xfwrite(str, strlen(str), 1, data);
> +       if (*str != '\0')
> +               xfwrite(str, strlen(str), 1, data);
> +       else
> +               xfwrite("\"\"", 2, 1, data);
>  }
>
>  void expr_fprint(struct expr *e, FILE *out)
> --
> 2.13.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 2/3] kconfig: handle P_SYMBOL in print_symbol()
  2018-06-22 19:27 ` [PATCH 2/3] kconfig: handle P_SYMBOL in print_symbol() Dirk Gouders
@ 2018-06-27 16:30   ` Masahiro Yamada
  0 siblings, 0 replies; 19+ messages in thread
From: Masahiro Yamada @ 2018-06-27 16:30 UTC (permalink / raw)
  To: Dirk Gouders; +Cc: Linux Kbuild mailing list, Sam Ravnborg

2018-06-23 4:27 GMT+09:00 Dirk Gouders <dirk@gouders.net>:
> Each symbol has a property of type P_SYMBOL since commit
> 59e89e3ddf8523be (kconfig: save location of config symbols).
> Handle those properties in print_symbol().
>
> Further, place a pointer to print_symbol() in the comment above the
> list of known property type.
>
> Signed-off-by: Dirk Gouders <dirk@gouders.net>
> Cc: Sam Ravnborg <sam@ravnborg.org>


Applied to linux-kbuild/fixes. Thanks!

> ---
>  scripts/kconfig/expr.h  | 3 +++
>  scripts/kconfig/zconf.y | 4 ++++
>  2 files changed, 7 insertions(+)
>
> diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
> index 94a383b21df6..f63b41b0dd49 100644
> --- a/scripts/kconfig/expr.h
> +++ b/scripts/kconfig/expr.h
> @@ -171,6 +171,9 @@ struct symbol {
>   * config BAZ
>   *         int "BAZ Value"
>   *         range 1..255
> + *
> + * Please, also check zconf.y:print_symbol() when modifying the
> + * list of property types!
>   */
>  enum prop_type {
>         P_UNKNOWN,
> diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
> index 6f9b0aa32a82..525b82c5fb58 100644
> --- a/scripts/kconfig/zconf.y
> +++ b/scripts/kconfig/zconf.y
> @@ -717,6 +717,10 @@ static void print_symbol(FILE *out, struct menu *menu)
>                         print_quoted_string(out, prop->text);
>                         fputc('\n', out);
>                         break;
> +               case P_SYMBOL:
> +                       fputs( "  symbol ", out);
> +                       fprintf(out, "%s\n", prop->sym->name);
> +                       break;
>                 default:
>                         fprintf(out, "  unknown prop %d!\n", prop->type);
>                         break;
> --
> 2.13.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/3] kconfig: avoid assert()-triggered segfaults in xfwrite()
  2018-06-27 16:29   ` Masahiro Yamada
@ 2018-06-27 19:23     ` Dirk Gouders
  2018-06-29  9:12       ` [PATCH 0/2] kconfig: expr_print(): print constant symbols within quotes Dirk Gouders
  0 siblings, 1 reply; 19+ messages in thread
From: Dirk Gouders @ 2018-06-27 19:23 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Kbuild mailing list

Masahiro Yamada <yamada.masahiro@socionext.com> writes:

> 2018-06-23 4:27 GMT+09:00 Dirk Gouders <dirk@gouders.net>:
>> xfwrite uses assert() to ensure it does not operate on empty strings.
>> Two users respect this, expr_print_file_helper() doesn't and causes
>> segfaults e.g. when the dependency for an empty default string is printed.
>>
>> Fix this by calling xfwrite with an empty string pattern ("") for
>> empty strings.
>>
>> INITRAMFS_SOURCE was one symbol that caused this problem, with this
>> fix applied the zconfdump() output for this symbol looks as follows:
>>
>> ------------------------------------------------------------------------
>> config INITRAMFS_SOURCE
>>   string
>>   symbol INITRAMFS_SOURCE
>>   prompt "Initramfs source file(s)" if BLK_DEV_INITRD
>>   default "" if BLK_DEV_INITRD
>>   help
>> This can be either a single cpio archive with a .cpio suffix or a
>> space-separated list of directories and files for building the
>> initramfs image.  A cpio archive should contain a filesystem archive
>> to be used as an initramfs image.  Directories should contain a
>> filesystem layout to be included in the initramfs image.  Files
>> should contain entries according to the format described by the
>> "usr/gen_init_cpio" program in the kernel tree.
>>
>> When multiple directories and files are specified then the
>> initramfs image will be the aggregate of all of them.
>>
>> See <file:Documentation/early-userspace/README> for more details.
>>
>> If you are not sure, leave it blank.
>> ------------------------------------------------------------------------
>>
>> Signed-off-by: Dirk Gouders <dirk@gouders.net>
>> ---
>
>
> Hmm, please let me think about this.
>
> I know this is an easy way to fix the seg-fault,
> but I think it is not a correct way.
>
>
>
> If the config entry were like this:
>
> config INITRAMFS_SOURCE
>         string "Initramfs source file(s)"
>         default "foo"
>
>
>
> It would be dumped like this:
>
> config INITRAMFS_SOURCE
>   string
>   symbol INITRAMFS_SOURCE
>   prompt "Initramfs source file(s)"
>   default foo
>
>
>
>
> I want it to be displayed like this:
>
>    default "foo"
>
>
> If we can quote the string values,
> the problem will be eventually fixed.
>
> It may not be easy to fix it...

That's a good idea, it provides more consistency.

I will send an update and also replace the term "segfault" with "abort"
as this is the way assert() terminates the program.

Dirk

>
>>  scripts/kconfig/expr.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
>> index e1a39e90841d..e064bf4c2881 100644
>> --- a/scripts/kconfig/expr.c
>> +++ b/scripts/kconfig/expr.c
>> @@ -1231,7 +1231,10 @@ void expr_print(struct expr *e,
>>
>>  static void expr_print_file_helper(void *data, struct symbol *sym, const char *str)
>>  {
>> -       xfwrite(str, strlen(str), 1, data);
>> +       if (*str != '\0')
>> +               xfwrite(str, strlen(str), 1, data);
>> +       else
>> +               xfwrite("\"\"", 2, 1, data);
>>  }
>>
>>  void expr_fprint(struct expr *e, FILE *out)
>> --
>> 2.13.6
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 0/2] kconfig: expr_print(): print constant symbols within quotes
  2018-06-27 19:23     ` Dirk Gouders
@ 2018-06-29  9:12       ` Dirk Gouders
  2018-06-29  9:12         ` [PATCH v2 1/2] " Dirk Gouders
  2018-06-29  9:12         ` [PATCH 2/2] kconfig: fix comment for symbol flag SYMBOL_AUTO Dirk Gouders
  0 siblings, 2 replies; 19+ messages in thread
From: Dirk Gouders @ 2018-06-29  9:12 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Dirk Gouders, Linux Kbuild mailing list

Hi Masahiro,

I reworked the fix for the aborts in a way you suggested.
I decided to do it that way, because it reproduces the real content of Kconfig files.
I hope that was what you meant with your comment to the previous attempt.

While working on that fix I found a comment in expr.h that seems to be wrong
and send a fix for that, as well.

Dirk

Dirk Gouders (2):
  kconfig: expr_print(): print constant symbols within quotes
  kconfig: fix comment for symbol flag SYMBOL_AUTO

 scripts/kconfig/expr.c | 12 +++++++++++-
 scripts/kconfig/expr.h |  4 +++-
 2 files changed, 14 insertions(+), 2 deletions(-)

-- 
2.16.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v2 1/2] kconfig: expr_print(): print constant symbols within quotes
  2018-06-29  9:12       ` [PATCH 0/2] kconfig: expr_print(): print constant symbols within quotes Dirk Gouders
@ 2018-06-29  9:12         ` Dirk Gouders
  2018-06-29  9:12         ` [PATCH 2/2] kconfig: fix comment for symbol flag SYMBOL_AUTO Dirk Gouders
  1 sibling, 0 replies; 19+ messages in thread
From: Dirk Gouders @ 2018-06-29  9:12 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Dirk Gouders, Linux Kbuild mailing list

Motivation for this commit was the problem that xfwrite() uses
assert() to ensure it does not operate on empty strings.  This caused
aborts when the dependency for an empty default string was printed.

A possibility to fix this issue would be to print all string
constants in quotes which has the positive effect that empty
strings have a length of 2 and do not trigger aborts.

But currently, constant symbols are typeless, so this patch implements
a fix by identifying all constant symbols by the symbol flag
SYMBOL_CONST and printing their names within quotes.

Note:

The symbols y, m and n are statically defined as constants in symbol.c
and hence also printed within quotes.  Kconfig files contain a mixture
of those symbols specified within and without quotes and we cannot
reproduce that after parsing.

Also, the kconfig language allows for (semantically meant) constant
string, int and hex symbols to be specified within quotes or without,
which is OK as long as there is no other symbol that is something
other than the constant symbol that was meant to be; the following
Kconfig file tries to illustrate this:

config a
       int "Meant to have default 5..."
       default 5

config 5
       int "but this symbol plays games."
       default "7"

This implementation reproduces exactly the described mixture from the
Kconfig files, thus original data.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
---
 scripts/kconfig/expr.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index e1a39e90841d..b36e94e36f84 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -1141,6 +1141,8 @@ void expr_print(struct expr *e,
 		void (*fn)(void *, struct symbol *, const char *),
 		void *data, int prevtoken)
 {
+	const char *quoted;
+
 	if (!e) {
 		fn(data, NULL, "y");
 		return;
@@ -1151,7 +1153,15 @@ void expr_print(struct expr *e,
 	switch (e->type) {
 	case E_SYMBOL:
 		if (e->left.sym->name)
-			fn(data, e->left.sym, e->left.sym->name);
+			/*
+			 * Print constant symbols within quotes
+			 */
+			if (e->left.sym->flags & SYMBOL_CONST) {
+				quoted = sym_escape_string_value(e->left.sym->name);
+				fn(data, e->left.sym, quoted);
+				free((void*)quoted);
+			} else
+				fn(data, e->left.sym, e->left.sym->name);
 		else
 			fn(data, NULL, "<choice>");
 		break;
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 2/2] kconfig: fix comment for symbol flag SYMBOL_AUTO
  2018-06-29  9:12       ` [PATCH 0/2] kconfig: expr_print(): print constant symbols within quotes Dirk Gouders
  2018-06-29  9:12         ` [PATCH v2 1/2] " Dirk Gouders
@ 2018-06-29  9:12         ` Dirk Gouders
  2018-07-02 15:14           ` Masahiro Yamada
  1 sibling, 1 reply; 19+ messages in thread
From: Dirk Gouders @ 2018-06-29  9:12 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Dirk Gouders, Linux Kbuild mailing list, Sam Ravnborg

I could not verify the comment for that symbol flag.

I could only find that flag set for choices and the defconfig_list
symbol in a dump of all symbols, which corresponds to the only two
locations in the code where that flag is being set explicitely.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/kconfig/expr.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
index 94a383b21df6..0f53e44f14d6 100644
--- a/scripts/kconfig/expr.h
+++ b/scripts/kconfig/expr.h
@@ -141,7 +141,9 @@ struct symbol {
 #define SYMBOL_OPTIONAL   0x0100  /* choice is optional - values can be 'n' */
 #define SYMBOL_WRITE      0x0200  /* write symbol to file (KCONFIG_CONFIG) */
 #define SYMBOL_CHANGED    0x0400  /* ? */
-#define SYMBOL_AUTO       0x1000  /* value from environment variable */
+#define SYMBOL_AUTO       0x1000  /* Symbols of type choice and the
+				   * symbol with option defconfig_list
+				   * have this flag set */
 #define SYMBOL_CHECKED    0x2000  /* used during dependency checking */
 #define SYMBOL_WARNED     0x8000  /* warning has been issued */
 
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 2/2] kconfig: fix comment for symbol flag SYMBOL_AUTO
  2018-06-29  9:12         ` [PATCH 2/2] kconfig: fix comment for symbol flag SYMBOL_AUTO Dirk Gouders
@ 2018-07-02 15:14           ` Masahiro Yamada
  2018-07-03  7:32             ` Dirk Gouders
  2018-07-03  9:10             ` [PATCH v2] kconfig: fix comment for symbol flag SYMBOL_AUTO Dirk Gouders
  0 siblings, 2 replies; 19+ messages in thread
From: Masahiro Yamada @ 2018-07-02 15:14 UTC (permalink / raw)
  To: Dirk Gouders; +Cc: Linux Kbuild mailing list, Sam Ravnborg

2018-06-29 18:12 GMT+09:00 Dirk Gouders <dirk@gouders.net>:
> I could not verify the comment for that symbol flag.

Good catch.
I forgot to fix up the comment
in commit 104daea149c4.


> I could only find that flag set for choices and the defconfig_list
> symbol in a dump of all symbols, which corresponds to the only two
> locations in the code where that flag is being set explicitely.
>
> Signed-off-by: Dirk Gouders <dirk@gouders.net>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> ---
>  scripts/kconfig/expr.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
> index 94a383b21df6..0f53e44f14d6 100644
> --- a/scripts/kconfig/expr.h
> +++ b/scripts/kconfig/expr.h
> @@ -141,7 +141,9 @@ struct symbol {
>  #define SYMBOL_OPTIONAL   0x0100  /* choice is optional - values can be 'n' */
>  #define SYMBOL_WRITE      0x0200  /* write symbol to file (KCONFIG_CONFIG) */
>  #define SYMBOL_CHANGED    0x0400  /* ? */
> -#define SYMBOL_AUTO       0x1000  /* value from environment variable */
> +#define SYMBOL_AUTO       0x1000  /* Symbols of type choice and the
> +                                  * symbol with option defconfig_list
> +                                  * have this flag set */

Hmm.  This explanation is not very helpful in my opinion.
Could you reword that?

In my understanding, symbols with SYMBOL_AUTO
are never written out to file.





>  #define SYMBOL_CHECKED    0x2000  /* used during dependency checking */
>  #define SYMBOL_WARNED     0x8000  /* warning has been issued */
>
> --
> 2.16.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 2/2] kconfig: fix comment for symbol flag SYMBOL_AUTO
  2018-07-02 15:14           ` Masahiro Yamada
@ 2018-07-03  7:32             ` Dirk Gouders
  2018-07-03  7:51               ` Masahiro Yamada
  2018-07-03  9:10             ` [PATCH v2] kconfig: fix comment for symbol flag SYMBOL_AUTO Dirk Gouders
  1 sibling, 1 reply; 19+ messages in thread
From: Dirk Gouders @ 2018-07-03  7:32 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Kbuild mailing list, Sam Ravnborg

Masahiro Yamada <yamada.masahiro@socionext.com> writes:

> 2018-06-29 18:12 GMT+09:00 Dirk Gouders <dirk@gouders.net>:
>> I could not verify the comment for that symbol flag.
>
> Good catch.
> I forgot to fix up the comment
> in commit 104daea149c4.
>
>
>> I could only find that flag set for choices and the defconfig_list
>> symbol in a dump of all symbols, which corresponds to the only two
>> locations in the code where that flag is being set explicitely.
>>
>> Signed-off-by: Dirk Gouders <dirk@gouders.net>
>> Cc: Sam Ravnborg <sam@ravnborg.org>
>> ---
>>  scripts/kconfig/expr.h | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
>> index 94a383b21df6..0f53e44f14d6 100644
>> --- a/scripts/kconfig/expr.h
>> +++ b/scripts/kconfig/expr.h
>> @@ -141,7 +141,9 @@ struct symbol {
>>  #define SYMBOL_OPTIONAL   0x0100  /* choice is optional - values can be 'n' */
>>  #define SYMBOL_WRITE      0x0200  /* write symbol to file (KCONFIG_CONFIG) */
>>  #define SYMBOL_CHANGED    0x0400  /* ? */
>> -#define SYMBOL_AUTO       0x1000  /* value from environment variable */
>> +#define SYMBOL_AUTO       0x1000  /* Symbols of type choice and the
>> +                                  * symbol with option defconfig_list
>> +                                  * have this flag set */
>
> Hmm.  This explanation is not very helpful in my opinion.
> Could you reword that?
>
> In my understanding, symbols with SYMBOL_AUTO
> are never written out to file.

Yes, that's right, sym_calc_value() clears SYMBOL_WRITE for those
symbols and the comment should describe the effect of the flag, not it's
users.  I will read a bit more to see if the flag has more effects and
reword the comment.

Sidenote: probably, AUTO is a misnomer for this flag.  I would expect
something like automatically generated symbols but the symbols that have
this flag set are rather -- hmm, perhaps auxiliary symbols?

Dirk

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 2/2] kconfig: fix comment for symbol flag SYMBOL_AUTO
  2018-07-03  7:32             ` Dirk Gouders
@ 2018-07-03  7:51               ` Masahiro Yamada
  2018-07-03  9:37                 ` Dirk Gouders
  0 siblings, 1 reply; 19+ messages in thread
From: Masahiro Yamada @ 2018-07-03  7:51 UTC (permalink / raw)
  To: Dirk Gouders; +Cc: Linux Kbuild mailing list, Sam Ravnborg, Ulf Magnusson

2018-07-03 16:32 GMT+09:00 Dirk Gouders <dirk@gouders.net>:
> Masahiro Yamada <yamada.masahiro@socionext.com> writes:
>
>> 2018-06-29 18:12 GMT+09:00 Dirk Gouders <dirk@gouders.net>:
>>> I could not verify the comment for that symbol flag.
>>
>> Good catch.
>> I forgot to fix up the comment
>> in commit 104daea149c4.
>>
>>
>>> I could only find that flag set for choices and the defconfig_list
>>> symbol in a dump of all symbols, which corresponds to the only two
>>> locations in the code where that flag is being set explicitely.
>>>
>>> Signed-off-by: Dirk Gouders <dirk@gouders.net>
>>> Cc: Sam Ravnborg <sam@ravnborg.org>
>>> ---
>>>  scripts/kconfig/expr.h | 4 +++-
>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
>>> index 94a383b21df6..0f53e44f14d6 100644
>>> --- a/scripts/kconfig/expr.h
>>> +++ b/scripts/kconfig/expr.h
>>> @@ -141,7 +141,9 @@ struct symbol {
>>>  #define SYMBOL_OPTIONAL   0x0100  /* choice is optional - values can be 'n' */
>>>  #define SYMBOL_WRITE      0x0200  /* write symbol to file (KCONFIG_CONFIG) */
>>>  #define SYMBOL_CHANGED    0x0400  /* ? */
>>> -#define SYMBOL_AUTO       0x1000  /* value from environment variable */
>>> +#define SYMBOL_AUTO       0x1000  /* Symbols of type choice and the
>>> +                                  * symbol with option defconfig_list
>>> +                                  * have this flag set */
>>
>> Hmm.  This explanation is not very helpful in my opinion.
>> Could you reword that?
>>
>> In my understanding, symbols with SYMBOL_AUTO
>> are never written out to file.
>
> Yes, that's right, sym_calc_value() clears SYMBOL_WRITE for those
> symbols and the comment should describe the effect of the flag, not it's
> users.  I will read a bit more to see if the flag has more effects and
> reword the comment.
>
> Sidenote: probably, AUTO is a misnomer for this flag.

I agree.


> I would expect
> something like automatically generated symbols but the symbols that have
> this flag set are rather -- hmm, perhaps auxiliary symbols?

Good.
Another idea might be SYMBOL_NO_WRITE ??
(it seems almost self-commenting)

-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v2] kconfig: fix comment for symbol flag SYMBOL_AUTO
  2018-07-02 15:14           ` Masahiro Yamada
  2018-07-03  7:32             ` Dirk Gouders
@ 2018-07-03  9:10             ` Dirk Gouders
  1 sibling, 0 replies; 19+ messages in thread
From: Dirk Gouders @ 2018-07-03  9:10 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Dirk Gouders, Linux Kbuild mailing list, Sam Ravnborg

Over time, the use of the flag changed from initially marking three
automatically generated symbols ARCH, KERNELRELEASE and UNAME_RELEASE
to protecting symbols from being written out, today.

Currently, only symbols of type CHOICE and those with option
defconf_list set have that flag set so that they are not written out.

Document the current effect of that flag.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/kconfig/expr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
index f63b41b0dd49..08f5e223a9e3 100644
--- a/scripts/kconfig/expr.h
+++ b/scripts/kconfig/expr.h
@@ -141,7 +141,7 @@ struct symbol {
 #define SYMBOL_OPTIONAL   0x0100  /* choice is optional - values can be 'n' */
 #define SYMBOL_WRITE      0x0200  /* write symbol to file (KCONFIG_CONFIG) */
 #define SYMBOL_CHANGED    0x0400  /* ? */
-#define SYMBOL_AUTO       0x1000  /* value from environment variable */
+#define SYMBOL_AUTO       0x1000  /* Symbol for internal use only; it will not be written */
 #define SYMBOL_CHECKED    0x2000  /* used during dependency checking */
 #define SYMBOL_WARNED     0x8000  /* warning has been issued */
 
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 2/2] kconfig: fix comment for symbol flag SYMBOL_AUTO
  2018-07-03  7:51               ` Masahiro Yamada
@ 2018-07-03  9:37                 ` Dirk Gouders
  2018-07-03 12:43                   ` [PATCH v3] kconfig: rename SYMBOL_AUTO to SYMBOL_NO_WRITE Dirk Gouders
  0 siblings, 1 reply; 19+ messages in thread
From: Dirk Gouders @ 2018-07-03  9:37 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Kbuild mailing list, Sam Ravnborg, Ulf Magnusson

Masahiro Yamada <yamada.masahiro@socionext.com> writes:

> 2018-07-03 16:32 GMT+09:00 Dirk Gouders <dirk@gouders.net>:
>> Masahiro Yamada <yamada.masahiro@socionext.com> writes:
>>
>>> 2018-06-29 18:12 GMT+09:00 Dirk Gouders <dirk@gouders.net>:
>>>> I could not verify the comment for that symbol flag.
>>>
>>> Good catch.
>>> I forgot to fix up the comment
>>> in commit 104daea149c4.
>>>
>>>
>>>> I could only find that flag set for choices and the defconfig_list
>>>> symbol in a dump of all symbols, which corresponds to the only two
>>>> locations in the code where that flag is being set explicitely.
>>>>
>>>> Signed-off-by: Dirk Gouders <dirk@gouders.net>
>>>> Cc: Sam Ravnborg <sam@ravnborg.org>
>>>> ---
>>>>  scripts/kconfig/expr.h | 4 +++-
>>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
>>>> index 94a383b21df6..0f53e44f14d6 100644
>>>> --- a/scripts/kconfig/expr.h
>>>> +++ b/scripts/kconfig/expr.h
>>>> @@ -141,7 +141,9 @@ struct symbol {
>>>>  #define SYMBOL_OPTIONAL   0x0100  /* choice is optional - values can be 'n' */
>>>>  #define SYMBOL_WRITE      0x0200  /* write symbol to file (KCONFIG_CONFIG) */
>>>>  #define SYMBOL_CHANGED    0x0400  /* ? */
>>>> -#define SYMBOL_AUTO       0x1000  /* value from environment variable */
>>>> +#define SYMBOL_AUTO       0x1000  /* Symbols of type choice and the
>>>> +                                  * symbol with option defconfig_list
>>>> +                                  * have this flag set */
>>>
>>> Hmm.  This explanation is not very helpful in my opinion.
>>> Could you reword that?
>>>
>>> In my understanding, symbols with SYMBOL_AUTO
>>> are never written out to file.
>>
>> Yes, that's right, sym_calc_value() clears SYMBOL_WRITE for those
>> symbols and the comment should describe the effect of the flag, not it's
>> users.  I will read a bit more to see if the flag has more effects and
>> reword the comment.
>>
>> Sidenote: probably, AUTO is a misnomer for this flag.
>
> I agree.
>
>
>> I would expect
>> something like automatically generated symbols but the symbols that have
>> this flag set are rather -- hmm, perhaps auxiliary symbols?
>
> Good.
> Another idea might be SYMBOL_NO_WRITE ??
> (it seems almost self-commenting)

Oh sorry, there was an overlap with me sending out v2 without
recognizing and reading your reply.

I like SYMBOL_NO_WRITE, and would prepare v3 if nobody has objections.

Dirk

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v3] kconfig: rename SYMBOL_AUTO to SYMBOL_NO_WRITE
  2018-07-03  9:37                 ` Dirk Gouders
@ 2018-07-03 12:43                   ` Dirk Gouders
  2018-07-06  2:54                     ` Masahiro Yamada
  0 siblings, 1 reply; 19+ messages in thread
From: Dirk Gouders @ 2018-07-03 12:43 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Dirk Gouders, Linux Kbuild mailing list, Sam Ravnborg, Ulf Magnusson

Over time, the use of the flag SYMBOL_AUTO changed from initially
marking three automatically generated symbols ARCH, KERNELRELEASE and
UNAME_RELEASE to today's effect of protecting symbols from being
written out.

Currently, only symbols of type CHOICE and those with option
defconf_list set have that flag set.

Reflect that change in semantics in the flag's name.

Signed-off-by: Dirk Gouders <dirk@gouders.net>
Cc: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/kconfig/confdata.c | 4 ++--
 scripts/kconfig/expr.h     | 2 +-
 scripts/kconfig/gconf.c    | 4 ++--
 scripts/kconfig/menu.c     | 2 +-
 scripts/kconfig/symbol.c   | 2 +-
 scripts/kconfig/zconf.y    | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 39e20974f4a3..d1216e4ade2f 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -397,7 +397,7 @@ int conf_read(const char *name)
 
 	for_all_symbols(i, sym) {
 		sym_calc_value(sym);
-		if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO))
+		if (sym_is_choice(sym) || (sym->flags & SYMBOL_NO_WRITE))
 			continue;
 		if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) {
 			/* check that calculated value agrees with saved value */
@@ -832,7 +832,7 @@ static int conf_split_config(void)
 	res = 0;
 	for_all_symbols(i, sym) {
 		sym_calc_value(sym);
-		if ((sym->flags & SYMBOL_AUTO) || !sym->name)
+		if ((sym->flags & SYMBOL_NO_WRITE) || !sym->name)
 			continue;
 		if (sym->flags & SYMBOL_WRITE) {
 			if (sym->flags & SYMBOL_DEF_AUTO) {
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h
index f63b41b0dd49..84a5199bb46b 100644
--- a/scripts/kconfig/expr.h
+++ b/scripts/kconfig/expr.h
@@ -141,7 +141,7 @@ struct symbol {
 #define SYMBOL_OPTIONAL   0x0100  /* choice is optional - values can be 'n' */
 #define SYMBOL_WRITE      0x0200  /* write symbol to file (KCONFIG_CONFIG) */
 #define SYMBOL_CHANGED    0x0400  /* ? */
-#define SYMBOL_AUTO       0x1000  /* value from environment variable */
+#define SYMBOL_NO_WRITE   0x1000  /* Symbol for internal use only; it will not be written */
 #define SYMBOL_CHECKED    0x2000  /* used during dependency checking */
 #define SYMBOL_WARNED     0x8000  /* warning has been issued */
 
diff --git a/scripts/kconfig/gconf.c b/scripts/kconfig/gconf.c
index 610c4ab54d76..a9e48cc7b50a 100644
--- a/scripts/kconfig/gconf.c
+++ b/scripts/kconfig/gconf.c
@@ -101,8 +101,8 @@ const char *dbg_sym_flags(int val)
 		strcat(buf, "write/");
 	if (val & SYMBOL_CHANGED)
 		strcat(buf, "changed/");
-	if (val & SYMBOL_AUTO)
-		strcat(buf, "auto/");
+	if (val & SYMBOL_NO_WRITE)
+		strcat(buf, "no_write/");
 
 	buf[strlen(buf) - 1] = '\0';
 
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 379a119dcd1e..4cf15d449c05 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -212,7 +212,7 @@ void menu_add_option(int token, char *arg)
 			sym_defconfig_list = current_entry->sym;
 		else if (sym_defconfig_list != current_entry->sym)
 			zconf_error("trying to redefine defconfig symbol");
-		sym_defconfig_list->flags |= SYMBOL_AUTO;
+		sym_defconfig_list->flags |= SYMBOL_NO_WRITE;
 		break;
 	case T_OPT_ALLNOCONFIG_Y:
 		current_entry->sym->flags |= SYMBOL_ALLNOCONFIG_Y;
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 7c9a88e91cfa..869a5e8e87a5 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -463,7 +463,7 @@ void sym_calc_value(struct symbol *sym)
 		}
 	}
 
-	if (sym->flags & SYMBOL_AUTO)
+	if (sym->flags & SYMBOL_NO_WRITE)
 		sym->flags &= ~SYMBOL_WRITE;
 
 	if (sym->flags & SYMBOL_NEED_SET_CHOICE_VALUES)
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 4b68272ebdb9..96081aa0fef0 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -265,7 +265,7 @@ symbol_option_arg:
 choice: T_CHOICE word_opt T_EOL
 {
 	struct symbol *sym = sym_lookup($2, SYMBOL_CHOICE);
-	sym->flags |= SYMBOL_AUTO;
+	sym->flags |= SYMBOL_NO_WRITE;
 	menu_add_entry(sym);
 	menu_add_expr(P_CHOICE, NULL, NULL);
 	free($2);
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/3] kconfig: add debugconfig target for debugging purposes
  2018-06-22 19:27 ` [PATCH 3/3] kconfig: add debugconfig target for debugging purposes Dirk Gouders
@ 2018-07-05  9:31   ` Masahiro Yamada
  2018-07-05 11:51     ` Dirk Gouders
  0 siblings, 1 reply; 19+ messages in thread
From: Masahiro Yamada @ 2018-07-05  9:31 UTC (permalink / raw)
  To: Dirk Gouders; +Cc: Linux Kbuild mailing list, Sam Ravnborg

2018-06-23 4:27 GMT+09:00 Dirk Gouders <dirk@gouders.net>:
> Currently, we need to modify existing kconfig targets to generate debugging
> information from the parser.  That information then has to be filtered
> somehow, automated tests are at least complicated to implement.
>
> Add a debugconfig target for pure debugging purposes; the initial
> version of this target dumps the menu tree and with the --debug option
> activates the parsers debugging output via it's global variable
> cdebug.  The environment variable ZCONF_DEBUG can be used to generate
> even more detailed debugging information.
>
> Sample output for a simple Kconfig file:
>
> $ scripts/kconfig/dconf --debug Kconfig.dconfig
> Kconfig.dconfig:1:config a
> Kconfig.dconfig:2:type(1)
> Kconfig.dconfig:4:endconfig
> Kconfig.dconfig:5:if
> Kconfig.dconfig:5:config b
> Kconfig.dconfig:6:type(1)
> Kconfig.dconfig:7:endconfig
> Kconfig.dconfig:7:endif
>
> config a
>   bool
>   symbol a
>   prompt "a"
>
> config b
>   bool
>   symbol b
>   prompt "b" if a
>
> endmenu
>
> Signed-off-by: Dirk Gouders <dirk@gouders.net>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> ---
>  scripts/kconfig/Makefile | 10 ++++++++-
>  scripts/kconfig/dconf.c  | 55 ++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 64 insertions(+), 1 deletion(-)
>  create mode 100644 scripts/kconfig/dconf.c
>
> diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
> index a3ac2c91331c..19906ff25392 100644
> --- a/scripts/kconfig/Makefile
> +++ b/scripts/kconfig/Makefile
> @@ -4,7 +4,7 @@
>  # These targets are used from top-level makefile
>
>  PHONY += xconfig gconfig menuconfig config syncconfig \
> -       localmodconfig localyesconfig
> +       localmodconfig localyesconfig debugconfig
>
>  ifdef KBUILD_KCONFIG
>  Kconfig := $(KBUILD_KCONFIG)
> @@ -34,6 +34,9 @@ config: $(obj)/conf
>  nconfig: $(obj)/nconf
>         $< $(silent) $(Kconfig)
>
> +debugconfig: $(obj)/dconf
> +       $< $(silent) $(Kconfig)
> +
>  # This has become an internal implementation detail and is now deprecated
>  # for external use.
>  syncconfig: $(obj)/conf
> @@ -149,6 +152,7 @@ help:
>         @echo  '  xenconfig       - Enable additional options for xen dom0 and guest kernel support'
>         @echo  '  tinyconfig      - Configure the tiniest possible kernel'
>         @echo  '  testconfig      - Run Kconfig unit tests (requires python3 and pytest)'
> +       @echo  '  debugconfig     - Debugging tool for developers'
>
>  # ===========================================================================
>  # Shared Makefile for the various kconfig executables:
> @@ -165,6 +169,10 @@ targets            += zconf.lex.c
>  HOSTCFLAGS_zconf.lex.o := -I$(src)
>  HOSTCFLAGS_zconf.tab.o := -I$(src)
>
> +# dconf: Used for kconfig debugging
> +hostprogs-y    += dconf
> +dconf-objs     := dconf.o zconf.tab.o
> +
>  # nconf: Used for the nconfig target based on ncurses
>  hostprogs-y    += nconf
>  nconf-objs     := nconf.o zconf.tab.o nconf.gui.o
> diff --git a/scripts/kconfig/dconf.c b/scripts/kconfig/dconf.c
> new file mode 100644
> index 000000000000..ed1edf607d80
> --- /dev/null
> +++ b/scripts/kconfig/dconf.c
> @@ -0,0 +1,55 @@
> +// SPDX-License-Identifier: GPL-2.0
> +//
> +// Copyright (C) 2018 Dirk Gouders <dirk@gouders.net>
> +
> +#include <stdlib.h>
> +#include <stdio.h>
> +#include <getopt.h>
> +
> +#include "lkc.h"
> +
> +extern int cdebug;
> +
> +void usage(const char *progname);
> +void usage(const char *progname)
> +{
> +       printf("Usage: %s --help | [--debug] <kconfig-file>\n", progname);
> +}
> +
> +int main(int argc, char *argv[])
> +{
> +       int c;
> +       int opt_index = 0;
> +       char *filename;
> +
> +       struct option long_opts[] = {
> +               {"debug", no_argument, NULL, 0},
> +               {"help", no_argument, NULL, 1},
> +               {0, 0, 0, 0}
> +       };
> +
> +       while (1 ) {
> +               c = getopt_long(argc, argv, "", long_opts, &opt_index);
> +
> +               if (c == -1)
> +                       break;
> +               if (c == 0) {
> +                       cdebug = 0x02;
> +               }
> +               if (c == 1) {
> +                       usage(argv[0]);
> +                       exit(EXIT_SUCCESS);
> +               }
> +       }
> +
> +       if (optind == argc) {
> +               usage(argv[0]);
> +               exit(EXIT_FAILURE);
> +       } else
> +               filename = argv[optind];
> +
> +       conf_parse(filename);
> +       zconfdump(stdout);
> +
> +       exit(EXIT_SUCCESS);
> +}
> --
> 2.13.6
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


You mentioned ZCONF_DEBUG in the log.

So, another possibility is to use
an environment variable to turn on debug features.

       name = getenv("KCONFIG_DEBUG");
       if (name && name[0] == '1')
               zconfdump(stdout);




-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/3] kconfig: add debugconfig target for debugging purposes
  2018-07-05  9:31   ` Masahiro Yamada
@ 2018-07-05 11:51     ` Dirk Gouders
  0 siblings, 0 replies; 19+ messages in thread
From: Dirk Gouders @ 2018-07-05 11:51 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Kbuild mailing list, Sam Ravnborg

[-- Attachment #1: Type: text/plain, Size: 7299 bytes --]

Masahiro Yamada <yamada.masahiro@socionext.com> writes:

> 2018-06-23 4:27 GMT+09:00 Dirk Gouders <dirk@gouders.net>:
>> Currently, we need to modify existing kconfig targets to generate debugging
>> information from the parser.  That information then has to be filtered
>> somehow, automated tests are at least complicated to implement.
>>
>> Add a debugconfig target for pure debugging purposes; the initial
>> version of this target dumps the menu tree and with the --debug option
>> activates the parsers debugging output via it's global variable
>> cdebug.  The environment variable ZCONF_DEBUG can be used to generate
>> even more detailed debugging information.
>>
>> Sample output for a simple Kconfig file:
>>
>> $ scripts/kconfig/dconf --debug Kconfig.dconfig
>> Kconfig.dconfig:1:config a
>> Kconfig.dconfig:2:type(1)
>> Kconfig.dconfig:4:endconfig
>> Kconfig.dconfig:5:if
>> Kconfig.dconfig:5:config b
>> Kconfig.dconfig:6:type(1)
>> Kconfig.dconfig:7:endconfig
>> Kconfig.dconfig:7:endif
>>
>> config a
>>   bool
>>   symbol a
>>   prompt "a"
>>
>> config b
>>   bool
>>   symbol b
>>   prompt "b" if a
>>
>> endmenu
>>
>> Signed-off-by: Dirk Gouders <dirk@gouders.net>
>> Cc: Sam Ravnborg <sam@ravnborg.org>
>> ---
>>  scripts/kconfig/Makefile | 10 ++++++++-
>>  scripts/kconfig/dconf.c  | 55 ++++++++++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 64 insertions(+), 1 deletion(-)
>>  create mode 100644 scripts/kconfig/dconf.c
>>
>> diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
>> index a3ac2c91331c..19906ff25392 100644
>> --- a/scripts/kconfig/Makefile
>> +++ b/scripts/kconfig/Makefile
>> @@ -4,7 +4,7 @@
>>  # These targets are used from top-level makefile
>>
>>  PHONY += xconfig gconfig menuconfig config syncconfig \
>> -       localmodconfig localyesconfig
>> +       localmodconfig localyesconfig debugconfig
>>
>>  ifdef KBUILD_KCONFIG
>>  Kconfig := $(KBUILD_KCONFIG)
>> @@ -34,6 +34,9 @@ config: $(obj)/conf
>>  nconfig: $(obj)/nconf
>>         $< $(silent) $(Kconfig)
>>
>> +debugconfig: $(obj)/dconf
>> +       $< $(silent) $(Kconfig)
>> +
>>  # This has become an internal implementation detail and is now deprecated
>>  # for external use.
>>  syncconfig: $(obj)/conf
>> @@ -149,6 +152,7 @@ help:
>>         @echo  '  xenconfig       - Enable additional options for xen dom0 and guest kernel support'
>>         @echo  '  tinyconfig      - Configure the tiniest possible kernel'
>>         @echo  '  testconfig      - Run Kconfig unit tests (requires python3 and pytest)'
>> +       @echo  '  debugconfig     - Debugging tool for developers'
>>
>>  # ===========================================================================
>>  # Shared Makefile for the various kconfig executables:
>> @@ -165,6 +169,10 @@ targets            += zconf.lex.c
>>  HOSTCFLAGS_zconf.lex.o := -I$(src)
>>  HOSTCFLAGS_zconf.tab.o := -I$(src)
>>
>> +# dconf: Used for kconfig debugging
>> +hostprogs-y    += dconf
>> +dconf-objs     := dconf.o zconf.tab.o
>> +
>>  # nconf: Used for the nconfig target based on ncurses
>>  hostprogs-y    += nconf
>>  nconf-objs     := nconf.o zconf.tab.o nconf.gui.o
>> diff --git a/scripts/kconfig/dconf.c b/scripts/kconfig/dconf.c
>> new file mode 100644
>> index 000000000000..ed1edf607d80
>> --- /dev/null
>> +++ b/scripts/kconfig/dconf.c
>> @@ -0,0 +1,55 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +//
>> +// Copyright (C) 2018 Dirk Gouders <dirk@gouders.net>
>> +
>> +#include <stdlib.h>
>> +#include <stdio.h>
>> +#include <getopt.h>
>> +
>> +#include "lkc.h"
>> +
>> +extern int cdebug;
>> +
>> +void usage(const char *progname);
>> +void usage(const char *progname)
>> +{
>> +       printf("Usage: %s --help | [--debug] <kconfig-file>\n", progname);
>> +}
>> +
>> +int main(int argc, char *argv[])
>> +{
>> +       int c;
>> +       int opt_index = 0;
>> +       char *filename;
>> +
>> +       struct option long_opts[] = {
>> +               {"debug", no_argument, NULL, 0},
>> +               {"help", no_argument, NULL, 1},
>> +               {0, 0, 0, 0}
>> +       };
>> +
>> +       while (1 ) {
>> +               c = getopt_long(argc, argv, "", long_opts, &opt_index);
>> +
>> +               if (c == -1)
>> +                       break;
>> +               if (c == 0) {
>> +                       cdebug = 0x02;
>> +               }
>> +               if (c == 1) {
>> +                       usage(argv[0]);
>> +                       exit(EXIT_SUCCESS);
>> +               }
>> +       }
>> +
>> +       if (optind == argc) {
>> +               usage(argv[0]);
>> +               exit(EXIT_FAILURE);
>> +       } else
>> +               filename = argv[optind];
>> +
>> +       conf_parse(filename);
>> +       zconfdump(stdout);
>> +
>> +       exit(EXIT_SUCCESS);
>> +}
>> --
>> 2.13.6
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
> You mentioned ZCONF_DEBUG in the log.
>
> So, another possibility is to use
> an environment variable to turn on debug features.
>
>        name = getenv("KCONFIG_DEBUG");
>        if (name && name[0] == '1')
>                zconfdump(stdout);

Yes, that would also be a possibility.  Perhaps even more flexibility
would be gained if a path is allowed for the content of the environment
variable to specify where the dump should go, e.g.
KCONFIG_DEBUG="./zconfdump-%d.out".  This way, we could dump without
disturbing std{err,out}.

Since some days, I am thinking about the possibility of a "knob" for
*config targets, once triggered, a dump will be produced to the
specified location.  But thinking of menuconfig, for example, I have not
yet an idea what this "knob" could be -- we don't have many unused keys
left.  Perhaps a signal...





The following is only meant for exchange of ideas -- I currently do some
debugging this way but chances are that all of it is not thought trough,
very well and too complicated:

I am wondering if -- instead of providing a debugging tool --
it would be more practical to offer developers a hook to enable easy use
of personal debugging tools through make(1) without disturbing git and
the need to trimm the mainstream Makefile every time:

1) Add a hook to scripts/kconfig/Makefile to allow developers to add
   own tools if they want to:
#
# Include optional Makefile that developers can trimm without
# disturbing git to make use of tools that are still under development
# or not adequate for mainstream.
#
-include scripts/kconfig/Makefile.devel

2) My Makefile.devel then looks like

PHONY += debugconfig

debugconfig: $(obj)/dconf
	$< $(silent) $(dconfargs) $(Kconfig)

# dconf: Used for kconfig debugging
hostprogs-y	+= dconf
dconf-objs	:= dconf.o zconf.tab.o


3) This allows me to call debugconfig like this:

   make dconfargs="--symdump=symdump" Kconfig=Kconfig_for_testing debugconfig

4) In case you are interested, my current debugging tool is attached.
   It grew a bit and it is bigger than it could be, because (for now) I
   want it to be standalone, without disturbing files that are
   controlled by git.

   The tool now also produces a dump of all symbols, a bit different
   compared to walking symbols via the menu.

Dirk


[-- Attachment #2: Personal debugging tool --]
[-- Type: text/plain, Size: 6298 bytes --]

// SPDX-License-Identifier: GPL-2.0
//
// Copyright (C) 2018 Dirk Gouders <dirk@gouders.net>

#include <stdlib.h>
#include <stdio.h>
#include <getopt.h>
#include <string.h>

#include "lkc.h"
#include "expr.h"

extern int cdebug;

#define SYMBOL_NO_WRITE       0x1000

void usage(const char *progname);
void usage(const char *progname)
{
	printf("Usage: %s --help | [--debug] [--menudump[=file]] [--symdump[=file]] <kconfig-file>\n", progname);
}

static void dconf_check_types()
{
}

static void print_quoted_string(FILE *out, const char *str)
{
	const char *p;
	int len;

	putc('"', out);
	while ((p = strchr(str, '"'))) {
		len = p - str;
		if (len)
			fprintf(out, "%.*s", len, str);
		fputs("\\\"", out);
		str = p + 1;
	}
	fputs(str, out);
	putc('"', out);
}

static void sym_print_flags(FILE *out, struct symbol *sym)
{
	char *space = "";

	fprintf(out, "Flags: ");

	if (!sym->flags) {
		fprintf(out, "\n");
		return;
	}

	if (sym->flags & SYMBOL_CONST) {
		fprintf(out, "CONST");
		space = ", ";
	}
	if (sym->flags & SYMBOL_CHECK) {
		fprintf(out, "%sCHECK", space);
		space = ", ";
	}
	if (sym->flags & SYMBOL_CHOICE) {
		fprintf(out, "%sCHOICE", space);
		space = ", ";
	}
	if (sym->flags & SYMBOL_CHOICEVAL) {
		fprintf(out, "%sCHOICEVAL", space);
		space = ", ";
	}
	if (sym->flags & SYMBOL_VALID) {
		fprintf(out, "%sVALID", space);
		space = ", ";
	}
	if (sym->flags & SYMBOL_OPTIONAL) {
		fprintf(out, "%sOPTIONAL", space);
		space = ", ";
	}
	if (sym->flags & SYMBOL_WRITE) {
		fprintf(out, "%sWRITE", space);
		space = ", ";
	}
	if (sym->flags & SYMBOL_CHANGED) {
		fprintf(out, "%sCHANGED", space);
		space = ", ";
	}
	if (sym->flags & SYMBOL_NO_WRITE) {
		fprintf(out, "%sNO_WRITE", space);
		space = ", ";
	}
	if (sym->flags & SYMBOL_CHECKED) {
		fprintf(out, "%sCHECKED", space);
		space = ", ";
	}
	if (sym->flags & SYMBOL_WARNED) {
		fprintf(out, "%sWARNED", space);
	}
	fprintf(out, "\n");
}
static void print_symbol(FILE *out, struct symbol *sym)
{
	struct property *prop;

	if (sym_is_choice(sym))
		fprintf(out, "\nchoice\n");
	else
		fprintf(out, "\nconfig %s\n", sym->name);

	sym_print_flags(out, sym);

	switch (sym->type) {
	case S_BOOLEAN:
		fputs("  bool\n", out);
		break;
	case S_TRISTATE:
		fputs("  tristate\n", out);
		break;
	case S_STRING:
		fputs("  string\n", out);
		break;
	case S_INT:
		fputs("  integer\n", out);
		break;
	case S_HEX:
		fputs("  hex\n", out);
		break;
	default:
		fputs("  unknown\n", out);
		break;
	}

	fprintf(out, "Value: %s\n", sym_get_string_value(sym));

	for (prop = sym->prop; prop; prop = prop->next) {
		switch (prop->type) {
		case P_PROMPT:
			fputs("  prompt ", out);
			print_quoted_string(out, prop->text);
			if (!expr_is_yes(prop->visible.expr)) {
				fputs(" if ", out);
				expr_fprint(prop->visible.expr, out);
			}
			fputc('\n', out);
			break;
		case P_DEFAULT:
			fputs( "  default ", out);
			expr_fprint(prop->expr, out);
			if (!expr_is_yes(prop->visible.expr)) {
				fputs(" if ", out);
				expr_fprint(prop->visible.expr, out);
			}
			fputc('\n', out);
			break;
		case P_CHOICE:
			fputs("  #choice value\n", out);
			break;
		case P_SELECT:
			fputs( "  select ", out);
			expr_fprint(prop->expr, out);
			if (!expr_is_yes(prop->visible.expr)) {
				fputs(" if ", out);
				expr_fprint(prop->visible.expr, out);
			}
			fputc('\n', out);
			break;
		case P_IMPLY:
			fputs( "  imply ", out);
			expr_fprint(prop->expr, out);
			if (!expr_is_yes(prop->visible.expr)) {
				fputs(" if ", out);
				expr_fprint(prop->visible.expr, out);
			}
			fputc('\n', out);
			break;
		case P_RANGE:
			fputs( "  range ", out);
			expr_fprint(prop->expr, out);
			if (!expr_is_yes(prop->visible.expr)) {
				fputs(" if ", out);
				expr_fprint(prop->visible.expr, out);
			}
			fputc('\n', out);
			break;
		case P_MENU:
			fputs( "  menu ", out);
			print_quoted_string(out, prop->text);
			fputc('\n', out);
			break;
		case P_SYMBOL:
			fputs( "  symbol ", out);
			if (prop->sym)
				fprintf(out, "%s (file %s:%d)\n", prop->sym->name,
					prop->file->name, prop->lineno);
			break;
		default:
			fprintf(out, "  unknown prop %d!\n", prop->type);
			break;
		}
	}

	fprintf(out, "  Depends on: ");
	if (!expr_is_yes(sym->dir_dep.expr))
		expr_fprint(sym->dir_dep.expr, out);

	fprintf(out, "\n  Selected by: ");
	if (!expr_is_yes(sym->rev_dep.expr))
		expr_fprint(sym->rev_dep.expr, out);

	fprintf(out, "\n  Implied by: ");
	if (!expr_is_yes(sym->implied.expr))
		expr_fprint(sym->implied.expr, out);

	fputc('\n', out);
}

void sym_dump(FILE *);
void sym_dump(FILE *out)
{
	struct symbol *sym;
	int i;

	print_symbol(out, &symbol_yes);
	print_symbol(out, &symbol_mod);
	print_symbol(out, &symbol_no);

	for_all_symbols(i, sym) {
		print_symbol(out, sym);
	}
}

int main(int argc, char *argv[])
{
	int c;
	int opt_index = 0;
	char *filename;

	int menudump = 0;	/* Print menu structure */
	FILE *menudump_out;

	int symdump = 0;	/* Print all symbols */
	FILE *symdump_out;

	struct option long_opts[] = {
		{"debug", no_argument, NULL, 0},
		{"help", no_argument, NULL, 1},
		{"menudump", optional_argument, NULL, 2},
		{"symdump", optional_argument, NULL, 3},
		{0, 0, 0, 0}
	};

	while (1 ) {
		c = getopt_long(argc, argv, "", long_opts, &opt_index);

		if (c == -1)
			break;
		if (c == 0) {
			cdebug = 0x02;
		}
		if (c == 1) {
			usage(argv[0]);
			exit(EXIT_SUCCESS);
		}
		if (c == 2) {
			menudump = 1;
			if (optarg) {
				if (!strcmp(optarg, "stdout"))
					menudump_out = stdout;
				else if (!strcmp(optarg, "stderr"))
					menudump_out = stderr;
				else {
					menudump_out = fopen(optarg, "w");
					if (!menudump_out) {
						perror(optarg);
					}
				}
			} else
				menudump_out = stdout;
		}
		if (c == 3) {
			symdump = 1;
			if (optarg) {
				if (!strcmp(optarg, "stdout"))
					symdump_out = stdout;
				else if (!strcmp(optarg, "stderr"))
					symdump_out = stderr;
				else {
					symdump_out = fopen(optarg, "w");
					if (!symdump_out) {
						perror(optarg);
					}
				}
			} else
				symdump_out = stdout;
		}
	}

	if (optind == argc) {
		usage(argv[0]);
		exit(EXIT_FAILURE);
	} else
		filename = argv[optind];

	//getc(stdin);
	conf_parse(filename);
	//conf_read(NULL);

	if (menudump)
		zconfdump(menudump_out);

	if (symdump)
		sym_dump(symdump_out);

	exit(EXIT_SUCCESS);
}

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] kconfig: rename SYMBOL_AUTO to SYMBOL_NO_WRITE
  2018-07-03 12:43                   ` [PATCH v3] kconfig: rename SYMBOL_AUTO to SYMBOL_NO_WRITE Dirk Gouders
@ 2018-07-06  2:54                     ` Masahiro Yamada
  0 siblings, 0 replies; 19+ messages in thread
From: Masahiro Yamada @ 2018-07-06  2:54 UTC (permalink / raw)
  To: Dirk Gouders; +Cc: Linux Kbuild mailing list, Sam Ravnborg, Ulf Magnusson

2018-07-03 21:43 GMT+09:00 Dirk Gouders <dirk@gouders.net>:
> Over time, the use of the flag SYMBOL_AUTO changed from initially
> marking three automatically generated symbols ARCH, KERNELRELEASE and
> UNAME_RELEASE to today's effect of protecting symbols from being
> written out.
>
> Currently, only symbols of type CHOICE and those with option
> defconf_list set have that flag set.
>
> Reflect that change in semantics in the flag's name.
>
> Signed-off-by: Dirk Gouders <dirk@gouders.net>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> ---

Applied to linux-kbuild/kconfig. Thanks!


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2018-07-06  2:55 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-22 19:27 [PATCH 0/3] Fixes concerning zconfdump() Dirk Gouders
2018-06-22 19:27 ` [PATCH 1/3] kconfig: avoid assert()-triggered segfaults in xfwrite() Dirk Gouders
2018-06-27 16:29   ` Masahiro Yamada
2018-06-27 19:23     ` Dirk Gouders
2018-06-29  9:12       ` [PATCH 0/2] kconfig: expr_print(): print constant symbols within quotes Dirk Gouders
2018-06-29  9:12         ` [PATCH v2 1/2] " Dirk Gouders
2018-06-29  9:12         ` [PATCH 2/2] kconfig: fix comment for symbol flag SYMBOL_AUTO Dirk Gouders
2018-07-02 15:14           ` Masahiro Yamada
2018-07-03  7:32             ` Dirk Gouders
2018-07-03  7:51               ` Masahiro Yamada
2018-07-03  9:37                 ` Dirk Gouders
2018-07-03 12:43                   ` [PATCH v3] kconfig: rename SYMBOL_AUTO to SYMBOL_NO_WRITE Dirk Gouders
2018-07-06  2:54                     ` Masahiro Yamada
2018-07-03  9:10             ` [PATCH v2] kconfig: fix comment for symbol flag SYMBOL_AUTO Dirk Gouders
2018-06-22 19:27 ` [PATCH 2/3] kconfig: handle P_SYMBOL in print_symbol() Dirk Gouders
2018-06-27 16:30   ` Masahiro Yamada
2018-06-22 19:27 ` [PATCH 3/3] kconfig: add debugconfig target for debugging purposes Dirk Gouders
2018-07-05  9:31   ` Masahiro Yamada
2018-07-05 11:51     ` Dirk Gouders

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.