aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZou Wei <[email protected]>2021-06-08 08:52:46 +0800
committerArnaldo Carvalho de Melo <[email protected]>2021-06-08 09:36:36 -0300
commitf54cad25a1fe4ca227c28f539ed285314016a768 (patch)
tree7396aa5fe342155f69896a05c9c07bb7729132c2
parentf4f1c42953c7f03a35cd7bc49c16f35911f50a0a (diff)
perf srccode: Use list_move() instead of equivalent list_del() + list_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]>
-rw-r--r--tools/perf/util/srccode.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/perf/util/srccode.c b/tools/perf/util/srccode.c
index c29edaaca863..476e99896d5e 100644
--- a/tools/perf/util/srccode.c
+++ b/tools/perf/util/srccode.c
@@ -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;
}
}