Skip to content

Commit

Permalink
perf srccode: Use list_move() instead of equivalent list_del() + list…
Browse files Browse the repository at this point in the history
…_add() sequence

Using list_move() instead of list_del() + list_add(), shorter,
equivalent.

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zou Wei <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
SamuelZOU authored and acmel committed Jun 8, 2021
1 parent f4f1c42 commit f54cad2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tools/perf/util/srccode.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ static struct srcfile *find_srcfile(char *fn)
hlist_for_each_entry (h, &srcfile_htab[hval], hash_nd) {
if (!strcmp(fn, h->fn)) {
/* Move to front */
list_del(&h->nd);
list_add(&h->nd, &srcfile_list);
list_move(&h->nd, &srcfile_list);
return h;
}
}
Expand Down

0 comments on commit f54cad2

Please sign in to comment.