Those two functions loop over the instructions of a function. Merge the two loops in order to ease enhancement of table end in a following patch.
Signed-off-by: Christophe Leroy <christophe.le...@csgroup.eu> --- tools/objtool/check.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 4495e7823b29..613d169eb6b8 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2061,10 +2061,11 @@ static void find_jump_table(struct objtool_file *file, struct symbol *func, * First pass: Mark the head of each jump table so that in the next pass, * we know when a given jump table ends and the next one starts. */ -static void mark_func_jump_tables(struct objtool_file *file, - struct symbol *func) +static int mark_add_func_jump_tables(struct objtool_file *file, + struct symbol *func) { - struct instruction *insn, *last = NULL; + struct instruction *insn, *last = NULL, *insn_t1 = NULL, *insn_t2; + int ret = 0; func_for_each_insn(file, func, insn) { if (!last) @@ -2088,16 +2089,7 @@ static void mark_func_jump_tables(struct objtool_file *file, continue; find_jump_table(file, func, insn); - } -} -static int add_func_jump_tables(struct objtool_file *file, - struct symbol *func) -{ - struct instruction *insn, *insn_t1 = NULL, *insn_t2; - int ret = 0; - - func_for_each_insn(file, func, insn) { if (!insn_jump_table(insn)) continue; @@ -2138,8 +2130,7 @@ static int add_jump_table_alts(struct objtool_file *file) if (func->type != STT_FUNC) continue; - mark_func_jump_tables(file, func); - ret = add_func_jump_tables(file, func); + ret = mark_add_func_jump_tables(file, func); if (ret) return ret; } -- 2.47.0