blob: 3ad9f1ec98369f2b259137711de01e8b5d8e0900 [file] [log] [blame]
Patrick Georgi53ea1d42019-11-22 16:55:58 +01001From 20df4491aa88eb4a7f97090fbc4ff53f81926861 Mon Sep 17 00:00:00 2001
2From: Martin Roth <martinroth@google.com>
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 <martinroth@google.com>
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
Patrick Georgi4c9b9e92022-10-28 01:00:26 +020026@@ -166,6 +166,16 @@ static void conf_warning(const char *fmt
Patrick Georgi53ea1d42019-11-22 16:55:58 +010027 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# ");
Patrick Georgi0eab62b2023-11-20 19:49:29 +010043@@ -454,7 +464,7 @@ load:
Patrick Georgi53ea1d42019-11-22 16:55:58 +010044 sym->type = S_BOOLEAN;
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 switch (sym->type) {
51 case S_BOOLEAN:
Patrick Georgi0eab62b2023-11-20 19:49:29 +010052@@ -498,7 +508,7 @@ load:
Patrick Georgi53ea1d42019-11-22 16:55:58 +010053 }
54
55 if (sym->flags & def_flags) {
56- conf_warning("override: reassigning to symbol %s", sym->name);
57+ conf_notice("override: reassigning to symbol %s", sym->name);
58 }
59 if (conf_set_sym_val(sym, def, def_flags, p))
60 continue;
Patrick Georgi0eab62b2023-11-20 19:49:29 +010061@@ -523,7 +533,7 @@ load:
Patrick Georgi53ea1d42019-11-22 16:55:58 +010062 break;
63 case yes:
64 if (cs->def[def].tri != no)
65- conf_warning("override: %s changes choice state", sym->name);
66+ conf_notice("override: %s changes choice state", sym->name);
67 cs->def[def].val = sym;
68 break;
69 }