Commit a78f70e8 authored by Michal Marek's avatar Michal Marek

genksyms: Handle string literals with spaces in reference files

The reference files use spaces to separate tokens, however, we must
preserve spaces inside string literals. Currently the only case in the
tree is struct edac_raw_error_desc in <linux/edac.h>:

$ KBUILD_SYMTYPES=1 make -s drivers/edac/amd64_edac.symtypes
$ mv drivers/edac/amd64_edac.{symtypes,symref}
$ KBUILD_SYMTYPES=1 make -s drivers/edac/amd64_edac.symtypes
drivers/edac/amd64_edac.c:527: warning: amd64_get_dram_hole_info: modversion changed because of changes in struct edac_raw_error_desc
Signed-off-by: default avatarMichal Marek <mmarek@suse.com>
parent 4c835b57
...@@ -423,13 +423,15 @@ static struct string_list *read_node(FILE *f) ...@@ -423,13 +423,15 @@ static struct string_list *read_node(FILE *f)
struct string_list node = { struct string_list node = {
.string = buffer, .string = buffer,
.tag = SYM_NORMAL }; .tag = SYM_NORMAL };
int c; int c, in_string = 0;
while ((c = fgetc(f)) != EOF) { while ((c = fgetc(f)) != EOF) {
if (c == ' ') { if (!in_string && c == ' ') {
if (node.string == buffer) if (node.string == buffer)
continue; continue;
break; break;
} else if (c == '"') {
in_string = !in_string;
} else if (c == '\n') { } else if (c == '\n') {
if (node.string == buffer) if (node.string == buffer)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment