summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2018-05-28 05:21:43 -0400
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-05-28 14:31:19 -0400
commit5b31a9746756ea76b08be035b49c86319973b395 (patch)
treec2d474a9f72fa4a3937783458c1a411c0efe9706 /scripts
parent96d8e48da55ab294fb26ce695ab48a9e9829b4fa (diff)
kconfig: remove sym_expand_string_value()
There is no more caller of sym_expand_string_value(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/lkc_proto.h1
-rw-r--r--scripts/kconfig/symbol.c53
2 files changed, 0 insertions, 54 deletions
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h
index 9f465fe1ca85..c46929fab7d9 100644
--- a/scripts/kconfig/lkc_proto.h
+++ b/scripts/kconfig/lkc_proto.h
@@ -31,7 +31,6 @@ extern struct symbol * symbol_hash[SYMBOL_HASHSIZE];
31 31
32struct symbol * sym_lookup(const char *name, int flags); 32struct symbol * sym_lookup(const char *name, int flags);
33struct symbol * sym_find(const char *name); 33struct symbol * sym_find(const char *name);
34char *sym_expand_string_value(const char *in);
35const char * sym_escape_string_value(const char *in); 34const char * sym_escape_string_value(const char *in);
36struct symbol ** sym_re_search(const char *pattern); 35struct symbol ** sym_re_search(const char *pattern);
37const char * sym_type_name(enum symbol_type type); 36const char * sym_type_name(enum symbol_type type);
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 2460648a581a..7c9a88e91cfa 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -879,59 +879,6 @@ struct symbol *sym_find(const char *name)
879 return symbol; 879 return symbol;
880} 880}
881 881
882/*
883 * Expand symbol's names embedded in the string given in argument. Symbols'
884 * name to be expanded shall be prefixed by a '$'. Unknown symbol expands to
885 * the empty string.
886 */
887char *sym_expand_string_value(const char *in)
888{
889 const char *src;
890 char *res;
891 size_t reslen;
892
893 /*
894 * Note: 'in' might come from a token that's about to be
895 * freed, so make sure to always allocate a new string
896 */
897 reslen = strlen(in) + 1;
898 res = xmalloc(reslen);
899 res[0] = '\0';
900
901 while ((src = strchr(in, '$'))) {
902 char *p, name[SYMBOL_MAXLENGTH];
903 const char *symval = "";
904 struct symbol *sym;
905 size_t newlen;
906
907 strncat(res, in, src - in);
908 src++;
909
910 p = name;
911 while (isalnum(*src) || *src == '_')
912 *p++ = *src++;
913 *p = '\0';
914
915 sym = sym_find(name);
916 if (sym != NULL) {
917 sym_calc_value(sym);
918 symval = sym_get_string_value(sym);
919 }
920
921 newlen = strlen(res) + strlen(symval) + strlen(src) + 1;
922 if (newlen > reslen) {
923 reslen = newlen;
924 res = xrealloc(res, reslen);
925 }
926
927 strcat(res, symval);
928 in = src;
929 }
930 strcat(res, in);
931
932 return res;
933}
934
935const char *sym_escape_string_value(const char *in) 882const char *sym_escape_string_value(const char *in)
936{ 883{
937 const char *p; 884 const char *p;