Patrick Georgi | 53ea1d4 | 2019-11-22 16:55:58 +0100 | [diff] [blame] | 1 | From 20df4491aa88eb4a7f97090fbc4ff53f81926861 Mon Sep 17 00:00:00 2001 |
| 2 | From: Martin Roth <martinroth@google.com> |
| 3 | Date: Wed, 21 Sep 2016 14:27:26 -0600 |
| 4 | Subject: [PATCH] Kconfig: Change symbol override from warning to notice |
| 5 | |
| 6 | Overriding symbols within a .config is pretty common when doing |
| 7 | automated builds with various different options. The warning |
| 8 | text 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 |
| 10 | not a bad thing to know that we have two copies of the same symbol |
| 11 | in the .config. |
| 12 | |
| 13 | BUG=chrome-os-partner:54059 |
| 14 | TEST=copy a disabled kconfig option to the end and set it to y. |
| 15 | See notice text instead of warning. |
| 16 | |
| 17 | Signed-off-by: Martin Roth <martinroth@google.com> |
| 18 | --- |
| 19 | util/kconfig/confdata.c | 16 +++++++++++++--- |
| 20 | 1 file changed, 13 insertions(+), 3 deletions(-) |
| 21 | |
| 22 | Index: kconfig/confdata.c |
| 23 | =================================================================== |
| 24 | --- kconfig.orig/confdata.c |
| 25 | +++ kconfig/confdata.c |
Patrick Georgi | 4c9b9e9 | 2022-10-28 01:00:26 +0200 | [diff] [blame] | 26 | @@ -166,6 +166,16 @@ static void conf_warning(const char *fmt |
Patrick Georgi | 53ea1d4 | 2019-11-22 16:55:58 +0100 | [diff] [blame] | 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# "); |
Patrick Georgi | 0eab62b | 2023-11-20 19:49:29 +0100 | [diff] [blame^] | 43 | @@ -454,7 +464,7 @@ load: |
Patrick Georgi | 53ea1d4 | 2019-11-22 16:55:58 +0100 | [diff] [blame] | 44 | 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 Georgi | 0eab62b | 2023-11-20 19:49:29 +0100 | [diff] [blame^] | 52 | @@ -498,7 +508,7 @@ load: |
Patrick Georgi | 53ea1d4 | 2019-11-22 16:55:58 +0100 | [diff] [blame] | 53 | } |
| 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 Georgi | 0eab62b | 2023-11-20 19:49:29 +0100 | [diff] [blame^] | 61 | @@ -523,7 +533,7 @@ load: |
Patrick Georgi | 53ea1d4 | 2019-11-22 16:55:58 +0100 | [diff] [blame] | 62 | 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 | } |