mirror of
https://github.com/dynup/kpatch
synced 2025-02-17 02:06:53 +00:00
lookup: minor lookup_open() cleanup
A couple of minor cleanups: - move the `if (locals)` check to find_local_syms() - remove the explicit initialization of `local_syms`, the entire struct was already previously cleared to zero.
This commit is contained in:
parent
85def82275
commit
23952b5ce0
@ -84,6 +84,9 @@ static void find_local_syms(struct lookup_table *table, char *hint,
|
||||
int i, in_file = 0;
|
||||
struct sym_compare_type *child_sym;
|
||||
|
||||
if (!child_locals)
|
||||
return;
|
||||
|
||||
for_each_obj_symbol(i, sym, table) {
|
||||
if (sym->type == STT_FILE) {
|
||||
if (in_file && !child_sym->name) {
|
||||
@ -287,10 +290,7 @@ struct lookup_table *lookup_open(char *obj_path, char *symvers_path,
|
||||
|
||||
obj_read(table, obj_path);
|
||||
symvers_read(table, symvers_path);
|
||||
|
||||
table->local_syms = NULL;
|
||||
if (locals)
|
||||
find_local_syms(table, hint, locals);
|
||||
find_local_syms(table, hint, locals);
|
||||
|
||||
return table;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user