]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
kallsyms: unify seq and start_pos fields of struct sym_entry
authorMasahiro Yamada <masahiroy@kernel.org>
Sat, 20 Jul 2024 16:21:13 +0000 (01:21 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sun, 21 Jul 2024 16:24:22 +0000 (01:24 +0900)
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>
scripts/kallsyms.c

index e291e34a450b3fb43c7e3a14dff83bdc1a7306bd..9a0535c59702458e93a3a679c636281af9c9e93f 100644 (file)
@@ -36,7 +36,6 @@ struct sym_entry {
        unsigned long long addr;
        unsigned int len;
        unsigned int seq;
-       unsigned int start_pos;
        unsigned int percpu_absolute;
        unsigned char sym[];
 };
@@ -278,7 +277,7 @@ static void read_map(const char *in)
                if (!sym)
                        continue;
 
-               sym->start_pos = table_cnt;
+               sym->seq = table_cnt;
 
                if (table_cnt >= table_size) {
                        table_size += 10000;
@@ -762,7 +761,7 @@ static int compare_symbols(const void *a, const void *b)
                return wa - wb;
 
        /* 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)