From: Zou Wei Date: Tue, 8 Jun 2021 00:52:46 +0000 (+0800) Subject: perf srccode: Use list_move() instead of equivalent list_del() + list_add() sequence X-Git-Tag: howlett/maple/20220722_2~2851^2~47 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f54cad25a1fe4ca227c28f539ed285314016a768;p=users%2Fjedix%2Flinux-maple.git 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 Signed-off-by: Zou Wei Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/1623113566-49455-1-git-send-email-zou_wei@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/srccode.c b/tools/perf/util/srccode.c index c29edaaca8633..476e99896d5e3 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; } }