All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] perf tools: Use list_move instead of list_del/list_add
@ 2021-06-08  0:52 Zou Wei
  2021-06-08 12:45 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 2+ messages in thread
From: Zou Wei @ 2021-06-08  0:52 UTC (permalink / raw)
  To: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	namhyung
  Cc: linux-perf-users, linux-kernel, Zou Wei

Using list_move() instead of list_del() + list_add().

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
---
 tools/perf/util/srccode.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/util/srccode.c b/tools/perf/util/srccode.c
index c29edaa..476e998 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;
 		}
 	}
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] perf tools: Use list_move instead of list_del/list_add
  2021-06-08  0:52 [PATCH -next] perf tools: Use list_move instead of list_del/list_add Zou Wei
@ 2021-06-08 12:45 ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-06-08 12:45 UTC (permalink / raw)
  To: Zou Wei
  Cc: peterz, mingo, mark.rutland, alexander.shishkin, jolsa, namhyung,
	linux-perf-users, linux-kernel

Em Tue, Jun 08, 2021 at 08:52:46AM +0800, Zou Wei escreveu:
> Using list_move() instead of list_del() + list_add().

Thanks, applied.

- Arnaldo

 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zou Wei <zou_wei@huawei.com>
> ---
>  tools/perf/util/srccode.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/srccode.c b/tools/perf/util/srccode.c
> index c29edaa..476e998 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;
>  		}
>  	}
> -- 
> 2.6.2
> 

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-08 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-08  0:52 [PATCH -next] perf tools: Use list_move instead of list_del/list_add Zou Wei
2021-06-08 12:45 ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.