Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3675598pxj; Mon, 7 Jun 2021 17:35:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyp06y5wyQz7cjyE6p+QRBBETYvsImibEVIL0As9pT1kb1Hwh8TZVAJCHfa9EmWSRRNnAvb X-Received: by 2002:a05:6402:2707:: with SMTP id y7mr4651354edd.0.1623112544924; Mon, 07 Jun 2021 17:35:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623112544; cv=none; d=google.com; s=arc-20160816; b=LiW1SEHOjX7ho+4IqBSErkgS3gmkYemgE94uECb19wSHFmSHHhhOMRemAGSvCSRWtf HkeR+akz24WNATFSy1RI5knixum9U1YqpmTCRa694U4P5dlBrnFGr8vLaQIryz276ggN OgZjviSo9gy2jXNw63d7QctV4bdfp+2TB3uEem0o1hL++xJaUKjv3N4PmYbaf6PRqy+Y 8UUFCm4+a/9PyGehKwppcPspAd83M9/cV/cGBMPLyyhyFzEcvR0wEBI1w2HrrEwaXQxU oGkmyPrk710+vKiPNKXq2NBjBrJ5stB171jvTnwb65Ehc0dVUMPaZb/O9RKyJGWll2PC 7lgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=Gjo6zW/KXoTY/mq6xU1x0YJfu8t3AlLKyewtCjmqEfQ=; b=Z078v1gwlYcgVlT80RkPq0DXbzhMzrIbKYW7g3bvrH7lKr5bF8LNY8/yVRn77f0qOy kjmt6MRDrtzerVG0PVMPS1jwY0+fz7m7xuNOfZcTJpVWB6XQbOUqTuA2+5qmGuY4m/LW SFdxtEPKzyYNFJAwnKQrn+J9JukxRPvqAUAw6YDD/DbaKNpp9rQH9XM9kljqcC4mcov3 f5paToT7Sf4v65m5OeupmaMnEaldVkvQF2ErLDJQ0zJplzWL3Wz1XEe7nPugk6SJSBaU EpvbGuQI0XdnMqF4f3G0kX9rIW1Cj8OmxyLPh3m0bEe6es7IgZwZoLD/INWQ1o7UyaWw fQqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s24si5292448ejs.124.2021.06.07.17.35.21; Mon, 07 Jun 2021 17:35:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230361AbhFHAgI (ORCPT + 99 others); Mon, 7 Jun 2021 20:36:08 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:4500 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230266AbhFHAgH (ORCPT ); Mon, 7 Jun 2021 20:36:07 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4FzWPm242yzZdjb; Tue, 8 Jun 2021 08:31:24 +0800 (CST) Received: from dggemi762-chm.china.huawei.com (10.1.198.148) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Tue, 8 Jun 2021 08:34:10 +0800 Received: from linux-lmwb.huawei.com (10.175.103.112) by dggemi762-chm.china.huawei.com (10.1.198.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Tue, 8 Jun 2021 08:34:09 +0800 From: Zou Wei To: , , , , , , CC: , , "Zou Wei" Subject: [PATCH -next] perf tools: Use list_move instead of list_del/list_add Date: Tue, 8 Jun 2021 08:52:46 +0800 Message-ID: <1623113566-49455-1-git-send-email-zou_wei@huawei.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.103.112] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggemi762-chm.china.huawei.com (10.1.198.148) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using list_move() instead of list_del() + list_add(). Reported-by: Hulk Robot Signed-off-by: Zou Wei --- 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