diff options
author | Gabe Black <gabeblack@google.com> | 2013-08-09 04:27:35 -0700 |
---|---|---|
committer | Isaac Christensen <isaac.christensen@se-eng.com> | 2014-08-05 18:44:08 +0200 |
commit | 1ee2c6dbdfe7e35ab5e25a6136eab824ed2fec8f (patch) | |
tree | fabae429ff872caed315281a0c243fa0bd753565 /payloads/libpayload/util | |
parent | b77431336e44ba9721f18220e2a7dedafe250528 (diff) |
libpayload: Change CONFIG_* to CONFIG_LP_* in the kconfig.
When libpayload header files are included in the payload itself, it's possible
that the payloads config settings will conflict with the ones in libpayload.
It's also possible for the libpayload config settings to conflict with the
payloads. To avoid that, the libpayload config settings have _LP_ (for
libpayload) added to them. The symbols themselves as defined in the Config.in files
are still the same, but the prefix added to them is now CONFIG_LP_ instead of just
CONFIG_.
Change-Id: Ib8a46d202e7880afdeac7924d69a949bfbcc5f97
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/65303
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Gabe Black <gabeblack@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
(cherry picked from commit 23e866da20862cace0ed2a67d6fb74056bc9ea9a)
Signed-off-by: Isaac Christensen <isaac.christensen@se-eng.com>
Reviewed-on: http://review.coreboot.org/6427
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
Diffstat (limited to 'payloads/libpayload/util')
-rw-r--r-- | payloads/libpayload/util/kconfig/confdata.c | 52 | ||||
-rw-r--r-- | payloads/libpayload/util/kconfig/mconf.c | 20 |
2 files changed, 36 insertions, 36 deletions
diff --git a/payloads/libpayload/util/kconfig/confdata.c b/payloads/libpayload/util/kconfig/confdata.c index b1f31d8d5e..a28b930ff0 100644 --- a/payloads/libpayload/util/kconfig/confdata.c +++ b/payloads/libpayload/util/kconfig/confdata.c @@ -219,22 +219,22 @@ load: sym = NULL; switch (line[0]) { case '#': - if (memcmp(line + 2, "CONFIG_", 7)) + if (memcmp(line + 2, "CONFIG_LP_", 10)) continue; - p = strchr(line + 9, ' '); + p = strchr(line + 12, ' '); if (!p) continue; *p++ = 0; if (strncmp(p, "is not set", 10)) continue; if (def == S_DEF_USER) { - sym = sym_find(line + 9); + sym = sym_find(line + 12); if (!sym) { - conf_warning("trying to assign nonexistent symbol %s", line + 9); + conf_warning("trying to assign nonexistent symbol %s", line + 12); break; } } else { - sym = sym_lookup(line + 9, 0); + sym = sym_lookup(line + 12, 0); if (sym->type == S_UNKNOWN) sym->type = S_BOOLEAN; } @@ -252,11 +252,11 @@ load: } break; case 'C': - if (memcmp(line, "CONFIG_", 7)) { + if (memcmp(line, "CONFIG_LP_", 10)) { conf_warning("unexpected data"); continue; } - p = strchr(line + 7, '='); + p = strchr(line + 10, '='); if (!p) continue; *p++ = 0; @@ -267,13 +267,13 @@ load: *p2 = 0; } if (def == S_DEF_USER) { - sym = sym_find(line + 7); + sym = sym_find(line + 10); if (!sym) { - conf_warning("trying to assign nonexistent symbol %s", line + 7); + conf_warning("trying to assign nonexistent symbol %s", line + 10); break; } } else { - sym = sym_lookup(line + 7, 0); + sym = sym_lookup(line + 10, 0); if (sym->type == S_UNKNOWN) sym->type = S_OTHER; } @@ -489,19 +489,19 @@ int conf_write(const char *name) case S_TRISTATE: switch (sym_get_tristate_value(sym)) { case no: - fprintf(out, "# CONFIG_%s is not set\n", sym->name); + fprintf(out, "# CONFIG_LP_%s is not set\n", sym->name); break; case mod: - fprintf(out, "CONFIG_%s=m\n", sym->name); + fprintf(out, "CONFIG_LP_%s=m\n", sym->name); break; case yes: - fprintf(out, "CONFIG_%s=y\n", sym->name); + fprintf(out, "CONFIG_LP_%s=y\n", sym->name); break; } break; case S_STRING: str = sym_get_string_value(sym); - fprintf(out, "CONFIG_%s=\"", sym->name); + fprintf(out, "CONFIG_LP_%s=\"", sym->name); while (1) { l = strcspn(str, "\"\\"); if (l) { @@ -517,12 +517,12 @@ int conf_write(const char *name) case S_HEX: str = sym_get_string_value(sym); if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { - fprintf(out, "CONFIG_%s=%s\n", sym->name, str); + fprintf(out, "CONFIG_LP_%s=%s\n", sym->name, str); break; } case S_INT: str = sym_get_string_value(sym); - fprintf(out, "CONFIG_%s=%s\n", sym->name, str); + fprintf(out, "CONFIG_LP_%s=%s\n", sym->name, str); break; } } @@ -730,19 +730,19 @@ int conf_write_autoconf(void) case no: break; case mod: - fprintf(out, "CONFIG_%s=m\n", sym->name); - fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name); + fprintf(out, "CONFIG_LP_%s=m\n", sym->name); + fprintf(out_h, "#define CONFIG_LP_%s_MODULE 1\n", sym->name); break; case yes: - fprintf(out, "CONFIG_%s=y\n", sym->name); - fprintf(out_h, "#define CONFIG_%s 1\n", sym->name); + fprintf(out, "CONFIG_LP_%s=y\n", sym->name); + fprintf(out_h, "#define CONFIG_LP_%s 1\n", sym->name); break; } break; case S_STRING: str = sym_get_string_value(sym); - fprintf(out, "CONFIG_%s=\"", sym->name); - fprintf(out_h, "#define CONFIG_%s \"", sym->name); + fprintf(out, "CONFIG_LP_%s=\"", sym->name); + fprintf(out_h, "#define CONFIG_LP_%s \"", sym->name); while (1) { l = strcspn(str, "\"\\"); if (l) { @@ -762,14 +762,14 @@ int conf_write_autoconf(void) case S_HEX: str = sym_get_string_value(sym); if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) { - fprintf(out, "CONFIG_%s=%s\n", sym->name, str); - fprintf(out_h, "#define CONFIG_%s 0x%s\n", sym->name, str); + fprintf(out, "CONFIG_LP_%s=%s\n", sym->name, str); + fprintf(out_h, "#define CONFIG_LP_%s 0x%s\n", sym->name, str); break; } case S_INT: str = sym_get_string_value(sym); - fprintf(out, "CONFIG_%s=%s\n", sym->name, str); - fprintf(out_h, "#define CONFIG_%s %s\n", sym->name, str); + fprintf(out, "CONFIG_LP_%s=%s\n", sym->name, str); + fprintf(out_h, "#define CONFIG_LP_%s %s\n", sym->name, str); break; default: break; diff --git a/payloads/libpayload/util/kconfig/mconf.c b/payloads/libpayload/util/kconfig/mconf.c index 5e93a308d8..fcebc50001 100644 --- a/payloads/libpayload/util/kconfig/mconf.c +++ b/payloads/libpayload/util/kconfig/mconf.c @@ -232,7 +232,7 @@ save_config_help[] = N_( "leave this blank.\n"), search_help[] = N_( "\n" - "Search for CONFIG_ symbols and display their relations.\n" + "Search for CONFIG_LP_ symbols and display their relations.\n" "Regular expressions are allowed.\n" "Example: search for \"^FOO\"\n" "Result:\n" @@ -249,7 +249,7 @@ search_help[] = N_( "Selected by: BAR\n" "-----------------------------------------------------------------\n" "o The line 'Prompt:' shows the text used in the menu structure for\n" - " this CONFIG_ symbol\n" + " this CONFIG_LP_ symbol\n" "o The 'Defined at' line tell at what file / line number the symbol\n" " is defined\n" "o The 'Depends on:' line tell what symbols needs to be defined for\n" @@ -265,9 +265,9 @@ search_help[] = N_( "Only relevant lines are shown.\n" "\n\n" "Search examples:\n" - "Examples: USB => find all CONFIG_ symbols containing USB\n" - " ^USB => find all CONFIG_ symbols starting with USB\n" - " USB$ => find all CONFIG_ symbols ending with USB\n" + "Examples: USB => find all CONFIG_LP_ symbols containing USB\n" + " ^USB => find all CONFIG_LP_ symbols starting with USB\n" + " USB$ => find all CONFIG_LP_ symbols ending with USB\n" "\n"); static int indent; @@ -388,8 +388,8 @@ static void search_conf(void) again: dialog_clear(); dres = dialog_inputbox(_("Search Configuration Parameter"), - _("Enter CONFIG_ (sub)string to search for " - "(with or without \"CONFIG\")"), + _("Enter CONFIG_LP_ (sub)string to search for " + "(with or without \"CONFIG_LP\")"), 10, 75, ""); switch (dres) { case 0: @@ -401,9 +401,9 @@ again: return; } - /* strip CONFIG_ if necessary */ + /* strip CONFIG_LP_ if necessary */ dialog_input = dialog_input_result; - if (strncasecmp(dialog_input_result, "CONFIG_", 7) == 0) + if (strncasecmp(dialog_input_result, "CONFIG_LP_", 10) == 0) dialog_input += 7; sym_arr = sym_re_search(dialog_input); @@ -704,7 +704,7 @@ static void show_help(struct menu *menu) if (menu_has_help(menu)) { if (sym->name) { - str_printf(&help, "CONFIG_%s:\n\n", sym->name); + str_printf(&help, "CONFIG_LP_%s:\n\n", sym->name); str_append(&help, _(menu_get_help(menu))); str_append(&help, "\n"); } |