1From 20df4491aa88eb4a7f97090fbc4ff53f81926861 Mon Sep 17 00:00:00 2001
2From: Martin Roth <[email protected]>
3Date: Wed, 21 Sep 2016 14:27:26 -0600
4Subject: [PATCH] Kconfig: Change symbol override from warning to notice
5
6Overriding symbols within a .config is pretty common when doing
7automated builds with various different options.  The warning
8text makes it sound like this is an issue, so change it to say
9'notice' instead.  We could get rid of it completely, but it's
10not a bad thing to know that we have two copies of the same symbol
11in the .config.
12
13BUG=chrome-os-partner:54059
14TEST=copy a disabled kconfig option to the end and set it to y.
15See notice text instead of warning.
16
17Signed-off-by: Martin Roth <[email protected]>
18---
19 util/kconfig/confdata.c | 16 +++++++++++++---
20 1 file changed, 13 insertions(+), 3 deletions(-)
21
22Index: kconfig/confdata.c
23===================================================================
24--- kconfig.orig/confdata.c
25+++ kconfig/confdata.c
26@@ -173,6 +173,16 @@ static void conf_warning(const char *fmt
27 	conf_warnings++;
28 }
29
30+static void conf_notice(const char *fmt, ...)
31+{
32+	va_list ap;
33+	va_start(ap, fmt);
34+	fprintf(stderr, "%s:%d:notice: ", conf_filename, conf_lineno);
35+	vfprintf(stderr, fmt, ap);
36+	fprintf(stderr, "\n");
37+	va_end(ap);
38+}
39+
40 static void conf_default_message_callback(const char *s)
41 {
42 	printf("#\n# ");
43@@ -503,7 +513,7 @@ load:
44 		}
45
46 		if (sym->flags & def_flags)
47-			conf_warning("override: reassigning to symbol %s", sym->name);
48+			conf_notice("override: reassigning to symbol %s", sym->name);
49
50 		if (conf_set_sym_val(sym, def, def_flags, val))
51 			continue;
52@@ -521,7 +531,7 @@ load:
53 				break;
54 			case yes:
55 				if (cs->def[def].tri != no)
56-					conf_warning("override: %s changes choice state", sym->name);
57+					conf_notice("override: %s changes choice state", sym->name);
58 				cs->def[def].val = sym;
59 				break;
60 			}
61