Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5145574pxj; Wed, 9 Jun 2021 10:08:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhLCK8P8EMH3zZs99m7LadPEsay1xmL0AensCWMOUlFn5A/QIdfMafHFZ+zeXoo3Q6kKXA X-Received: by 2002:aa7:c7cd:: with SMTP id o13mr433356eds.269.1623258522149; Wed, 09 Jun 2021 10:08:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623258522; cv=none; d=google.com; s=arc-20160816; b=yuDlPnkcLoLsI9Jrr1Mr99TKNmhqobupEEInIkFqRm3GdvDKGweV4pvQSdzU1j+WWZ 8LjzPJzv+Z1j7/Jv/DDPwQN6L3mhTvu+OL7EEPQnT47DO3fiFLXyW6Ss8UriEcGcjlTx JlC4+qSn5WmwWPoGCH5KYy4M3Hpr3GoOfkdabeBObM9vtxNguJ4hNC3KgKefvTaPP3j+ 6icwWBRySoElqQeLrnj9dZDMka7Jm9R/s9mr1YEDS+g8al9q0fYMNFJpD7wTwzDEP6lL enH9A+EVGVxChNnoIFKEa95K3A65sHk1JOifhnU/h6GrO/ib0AoxsX3JG8sqKBzSnSOy OG3g== 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=bHQ/bx2Cj7NbOXvEF20LDmCxlADCoHum+2vrQIx5Z7A=; b=k4hykKbXoCTnykRwm36XxNaExTWrN0BRfZ0/T+Kzdh3r+uMzCW3p9jLK1SElgvxvXf F93xgSsjSV1E9owYFqSykoi2krkpC5WieWFP+zoSqjz01FGBGLATNHtY9eBs8SppIwKw 7CI5tWaoUY5vhqSrpK5YOHfrEg/28vxCrQN9wW8FPfRvfudmEzOzWw9va61aPoLFjRv8 gytaqvSK7r3QShAPO0nmKvkn0pBa4JezXf7kTDkmaOqUG6VVg5G+8F2F3PZqSKmym1YJ JJ/QLymGOQ9UgNL43YWkgeFvAwSTwTyE6WdArN4ZSu/iMR8QSCDsm9FTKOIO0VjoJ8hz IebA== 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 e6si269423edz.248.2021.06.09.10.08.18; Wed, 09 Jun 2021 10:08:42 -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 S233958AbhFIGzb (ORCPT + 99 others); Wed, 9 Jun 2021 02:55:31 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:5300 "EHLO szxga08-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231902AbhFIGza (ORCPT ); Wed, 9 Jun 2021 02:55:30 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4G0Hkg0VWBz1BJml; Wed, 9 Jun 2021 14:48:43 +0800 (CST) Received: from dggpeml500020.china.huawei.com (7.185.36.88) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 9 Jun 2021 14:53:34 +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; Wed, 9 Jun 2021 14:53:34 +0800 From: Baokun Li To: , Thomas Gleixner CC: , , , , , , Hulk Robot Subject: [PATCH -next v2] clockevents: Use list_move instead of list_del/list_add in clockevents.c Date: Wed, 9 Jun 2021 15:02:42 +0800 Message-ID: <20210609070242.1322450-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: dggems705-chm.china.huawei.com (10.3.19.182) 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() in clockevents.c. Reported-by: Hulk Robot Signed-off-by: Baokun Li --- V1->V2: CC mailist kernel/time/clockevents.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 0056d2bed53e..d59ac319f9f4 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c @@ -347,8 +347,7 @@ static void clockevents_notify_released(void) while (!list_empty(&clockevents_released)) { dev = list_entry(clockevents_released.next, struct clock_event_device, list); - list_del(&dev->list); - list_add(&dev->list, &clockevent_devices); + list_move(&dev->list, &clockevent_devices); tick_check_new_device(dev); } } @@ -576,8 +575,7 @@ void clockevents_exchange_device(struct clock_event_device *old, if (old) { module_put(old->owner); clockevents_switch_state(old, CLOCK_EVT_STATE_DETACHED); - list_del(&old->list); - list_add(&old->list, &clockevents_released); + list_move(&old->list, &clockevents_released); } if (new) {