lkml.org 
[lkml]   [2020]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 06/16] objtool: Add a statistics mode
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

\
 
 \ /
  Last update: 2020-03-15 17:22    [W:0.199 / U:0.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site