Commit 1d48f8fe authored by Masahiro Yamada's avatar Masahiro Yamada

kallsyms: unify seq and start_pos fields of struct sym_entry

The struct sym_entry uses the 'seq' and 'start_pos' fields to remember
the index in the symbol table. They serve the same purpose and are not
used simultaneously. Unify them.
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent f9c3d671
...@@ -36,7 +36,6 @@ struct sym_entry { ...@@ -36,7 +36,6 @@ struct sym_entry {
unsigned long long addr; unsigned long long addr;
unsigned int len; unsigned int len;
unsigned int seq; unsigned int seq;
unsigned int start_pos;
unsigned int percpu_absolute; unsigned int percpu_absolute;
unsigned char sym[]; unsigned char sym[];
}; };
...@@ -278,7 +277,7 @@ static void read_map(const char *in) ...@@ -278,7 +277,7 @@ static void read_map(const char *in)
if (!sym) if (!sym)
continue; continue;
sym->start_pos = table_cnt; sym->seq = table_cnt;
if (table_cnt >= table_size) { if (table_cnt >= table_size) {
table_size += 10000; table_size += 10000;
...@@ -762,7 +761,7 @@ static int compare_symbols(const void *a, const void *b) ...@@ -762,7 +761,7 @@ static int compare_symbols(const void *a, const void *b)
return wa - wb; return wa - wb;
/* sort by initial order, so that other symbols are left undisturbed */ /* sort by initial order, so that other symbols are left undisturbed */
return sa->start_pos - sb->start_pos; return sa->seq - sb->seq;
} }
static void sort_symbols(void) static void sort_symbols(void)
......
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