Re: [RFC][PATCH 06/16] objtool: Add a statistics mode

From: Josh Poimboeuf
Date: Sun Mar 15 2020 - 12:21:03 EST


On Thu, Mar 12, 2020 at 02:41:13PM +0100, Peter Zijlstra wrote:
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -234,6 +234,7 @@ static int decode_instructions(struct ob
> struct symbol *func;
> unsigned long offset;
> struct instruction *insn;
> + unsigned long nr_insns = 0;
> int ret;
>
> for_each_sec(file, sec) {
> @@ -268,6 +269,7 @@ static int decode_instructions(struct ob
> goto err;
>
> hash_add(file->insn_hash, &insn->hash, insn->offset);
> + nr_insns++;
> list_add_tail(&insn->list, &file->insn_list);

It's slightly more readable to do the 'nr_insns++' after the
list_add_tail().

--
Josh