diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-02-08 11:19:08 -0500 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-02-09 21:31:49 -0500 |
commit | 523ca58b7db2e30e3c185a7927dd80a30c1bc743 (patch) | |
tree | 59c135f8bde7d4ec24f1270c1d8615b8b142f296 | |
parent | d717f24d8c68081caae2374cf5ea6c4e62c490fc (diff) |
kconfig: remove const qualifier from sym_expand_string_value()
This function returns realloc'ed memory, so the returned pointer
must be passed to free() when done. So, 'const' qualifier is odd.
It is allowed to modify the expanded string.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r-- | scripts/kconfig/lkc_proto.h | 2 | ||||
-rw-r--r-- | scripts/kconfig/symbol.c | 2 | ||||
-rw-r--r-- | scripts/kconfig/util.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/scripts/kconfig/lkc_proto.h b/scripts/kconfig/lkc_proto.h index 5d86e2dfae59..9dc8abfb1dc3 100644 --- a/scripts/kconfig/lkc_proto.h +++ b/scripts/kconfig/lkc_proto.h | |||
@@ -31,7 +31,7 @@ extern struct symbol * symbol_hash[SYMBOL_HASHSIZE]; | |||
31 | 31 | ||
32 | struct symbol * sym_lookup(const char *name, int flags); | 32 | struct symbol * sym_lookup(const char *name, int flags); |
33 | struct symbol * sym_find(const char *name); | 33 | struct symbol * sym_find(const char *name); |
34 | const char * sym_expand_string_value(const char *in); | 34 | char *sym_expand_string_value(const char *in); |
35 | const char * sym_escape_string_value(const char *in); | 35 | const char * sym_escape_string_value(const char *in); |
36 | struct symbol ** sym_re_search(const char *pattern); | 36 | struct symbol ** sym_re_search(const char *pattern); |
37 | const char * sym_type_name(enum symbol_type type); | 37 | const char * sym_type_name(enum symbol_type type); |
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index 60a76f958f33..cca9663be5dd 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c | |||
@@ -899,7 +899,7 @@ struct symbol *sym_find(const char *name) | |||
899 | * name to be expanded shall be prefixed by a '$'. Unknown symbol expands to | 899 | * name to be expanded shall be prefixed by a '$'. Unknown symbol expands to |
900 | * the empty string. | 900 | * the empty string. |
901 | */ | 901 | */ |
902 | const char *sym_expand_string_value(const char *in) | 902 | char *sym_expand_string_value(const char *in) |
903 | { | 903 | { |
904 | const char *src; | 904 | const char *src; |
905 | char *res; | 905 | char *res; |
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c index 138894ef49ea..b98a79e30e04 100644 --- a/scripts/kconfig/util.c +++ b/scripts/kconfig/util.c | |||
@@ -14,11 +14,11 @@ | |||
14 | struct file *file_lookup(const char *name) | 14 | struct file *file_lookup(const char *name) |
15 | { | 15 | { |
16 | struct file *file; | 16 | struct file *file; |
17 | const char *file_name = sym_expand_string_value(name); | 17 | char *file_name = sym_expand_string_value(name); |
18 | 18 | ||
19 | for (file = file_list; file; file = file->next) { | 19 | for (file = file_list; file; file = file->next) { |
20 | if (!strcmp(name, file->name)) { | 20 | if (!strcmp(name, file->name)) { |
21 | free((void *)file_name); | 21 | free(file_name); |
22 | return file; | 22 | return file; |
23 | } | 23 | } |
24 | } | 24 | } |