Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3750323pxj; Mon, 7 Jun 2021 20:06:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNYDlSfh9jq8KVaL1DqlAzY3hknz0FFut9nW2tCc452ehOefUng/KL3hF3pzPChwOpw5uh X-Received: by 2002:a17:907:abc:: with SMTP id bz28mr6184714ejc.446.1623121588073; Mon, 07 Jun 2021 20:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623121588; cv=none; d=google.com; s=arc-20160816; b=0KBpvRL05xbqeS7xWDzwN2fzjO1vdHjx13t14uRgmX7C8oZcsF70xpvDF8hGkU2Uwd CA9R1BchGItLPymuwDps2LRbq3WyhB5+AANX2cYmZo/eq/f2AyNagCgp9bdkLoQIY8BQ tLA265Nz/3/ICcaOPnAT6/xg+CmsDyrfyoepnU3428UDQcdsRMbp/NiHpX8QrKUKKQTY ZQ0n7HpFYNPrZj5YCDNH8o/M5xHc3qGn49hcGCwIpekT4SctEP1yKMJTzwFQWeiflOsL u9drP+OPfypYGElycV3MkdLd3NiPL+QlFuLl12BCeLGboOoDPdx+EdH2oNdpvWcmkiDw aEMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Mtun7zStwIwLMlPt+9AFqpKmoh9JUPjzCz6S33wg6t4=; b=j1yO4P6rqoFNgt+W5ZkisEeXjybr86UlMToaXesnyRM3BGPV07npWbyMtKr2QvKfY6 GERb+AGRORvMW55Cjd3zwoH93wYbPRdtz07LEWR9hE2vDyTbHxsZaAoPLN7GsiFfNKfR VMD2qM6SiMGanmw+us8wUSbH0nEohpYjVvlj4UE6pynadwrSbbZ9qxPDLLnN81nu2kU5 OlNW1LUWq7xeKyu5MjFEMMgF3M1rOq0++fUAb3H9hmBOtK7DUSPTtLPXLFnvuJVJ0qWH Z7kAxRLA+mxn6Xn1MFg60Q5AJ4T8QbgBNEfYdq4w23ii6HVWvMbTrrXgH/+lsLDRd3/q 6x5Q== 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 y4si14756723edi.355.2021.06.07.20.06.05; Mon, 07 Jun 2021 20:06:28 -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 S231582AbhFHDD7 (ORCPT + 99 others); Mon, 7 Jun 2021 23:03:59 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:4504 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231609AbhFHDDw (ORCPT ); Mon, 7 Jun 2021 23:03:52 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4FzZhF1DjlzZfZq; Tue, 8 Jun 2021 10:59:09 +0800 (CST) Received: from dggpeml500020.china.huawei.com (7.185.36.88) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 8 Jun 2021 11:01:58 +0800 Received: from huawei.com (10.175.127.227) by dggpeml500020.china.huawei.com (7.185.36.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 8 Jun 2021 11:01:57 +0800 From: Baokun Li To: , Steven Rostedt , "Ingo Molnar" CC: , , , , , , Hulk Robot Subject: [PATCH -next] ftrace: Use list_move instead of list_del/list_add Date: Tue, 8 Jun 2021 11:11:08 +0800 Message-ID: <20210608031108.2820996-1-libaokun1@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500020.china.huawei.com (7.185.36.88) 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: Baokun Li --- kernel/trace/ftrace.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 2e8a3fde7104..2c0374056637 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -4206,8 +4206,7 @@ static void process_mod_list(struct list_head *head, struct ftrace_ops *ops, if (!func) /* warn? */ continue; - list_del(&ftrace_mod->list); - list_add(&ftrace_mod->list, &process_mods); + list_move(&ftrace_mod->list, &process_mods); /* Use the newly allocated func, as it may be "*" */ kfree(ftrace_mod->func);