Skip to content

Commit 1d48f8f

Browse files
committed
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: Masahiro Yamada <masahiroy@kernel.org>
1 parent f9c3d67 commit 1d48f8f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scripts/kallsyms.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ struct sym_entry {
3636
unsigned long long addr;
3737
unsigned int len;
3838
unsigned int seq;
39-
unsigned int start_pos;
4039
unsigned int percpu_absolute;
4140
unsigned char sym[];
4241
};
@@ -278,7 +277,7 @@ static void read_map(const char *in)
278277
if (!sym)
279278
continue;
280279

281-
sym->start_pos = table_cnt;
280+
sym->seq = table_cnt;
282281

283282
if (table_cnt >= table_size) {
284283
table_size += 10000;
@@ -762,7 +761,7 @@ static int compare_symbols(const void *a, const void *b)
762761
return wa - wb;
763762

764763
/* sort by initial order, so that other symbols are left undisturbed */
765-
return sa->start_pos - sb->start_pos;
764+
return sa->seq - sb->seq;
766765
}
767766

768767
static void sort_symbols(void)

0 commit comments

Comments
 (0)