Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5145810pxj; Wed, 9 Jun 2021 10:08:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAsRHReT3f3z13g5/bNKRuuGpNDB3zr6nw5D2qqKUsRXs0DOpBv7l5jEcOT7amxs8pxe+h X-Received: by 2002:aa7:d5c9:: with SMTP id d9mr456159eds.278.1623258537763; Wed, 09 Jun 2021 10:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623258537; cv=none; d=google.com; s=arc-20160816; b=rx9ox43EbbNWG6EBuuRAK1d+09rYo3KR9SfAfT/H3OcmLuaka7xx6OgQXTPPwLcZ8h uWjNUxCb9PMnaQxVF6i/KcRElwiCMUYizrq7OSxdEiwGpI2bRwEhB+NOs6s0U7CSukqp 8GYuIV5FUKYPtREFLpNM0T3WyDFcRgwdEL2vKfIslzPtJdRP0PKPKfi3wZabBWVACPG1 d9W/t03TUjcB6eDz+Iw+Bx8vQJpLiklryer/ZB7lTeoJ4VaBcAvsiBioRSLhQPjzrHfo UmgDBI/oQ0F8qEuMy4xZwc5ybvumhgneVWzHigRjJXRzqg0ixBQYmsF2ywj8ZBMISDsn BrYQ== 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=cw7tOXUwkcq4pATm1+ZeUTIabPl5q3fN6Jufs1+67UE=; b=vcxu3IsXdlBHj5LLZeOLnHUi/drD5AWwzOhuF3D0tOHeaMW7CCD4WMHJS54byhWay6 oCjZdCuplWh24xowFGVeVUOGdw9HKwu7m8OX7zYLowDbh6sztd/YI1yI2BQiyQsvLbLM FV+XEOcGiExoVNzCmlM+5jDcvWBYAXZc24IvIWDpBWNX0JqvW8TGaDIJDiNc2/sjtree lZ6fkvAfZ4MsyMipwt9kNY2aKZ+RLESCS2v8ZlRRMWn5tRHgKEWIKL6s4WbuEd/qy4nB Cr4pbnNXmfQiJakuXLMlWH21ha9QQtX2NnMdWBPjGdrWpRZJj9hqu94zFw07YN+uGCb1 F/cA== 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 o1si164427edt.289.2021.06.09.10.08.33; Wed, 09 Jun 2021 10:08:57 -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 S233749AbhFIG61 (ORCPT + 99 others); Wed, 9 Jun 2021 02:58:27 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:8105 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231403AbhFIG6W (ORCPT ); Wed, 9 Jun 2021 02:58:22 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G0HrJ5z5NzYsX5; Wed, 9 Jun 2021 14:53:36 +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:56:26 +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:56:25 +0800 From: Baokun Li To: , Ben Skeggs , "David Airlie" , Daniel Vetter , Lyude Paul CC: , , , , , , , , Hulk Robot Subject: [PATCH -next v2] drm/nouveau/fifo: use list_move instead of list_del/list_add in base.c Date: Wed, 9 Jun 2021 15:05:34 +0800 Message-ID: <20210609070534.1324550-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() in base.c. Reported-by: Hulk Robot Signed-off-by: Baokun Li --- V1->V2: CC mailist drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c index 2ed4ff05d207..1802ac78b78f 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c @@ -79,8 +79,7 @@ nvkm_fifo_chan_inst_locked(struct nvkm_fifo *fifo, u64 inst) struct nvkm_fifo_chan *chan; list_for_each_entry(chan, &fifo->chan, head) { if (chan->inst->addr == inst) { - list_del(&chan->head); - list_add(&chan->head, &fifo->chan); + list_move(&chan->head, &fifo->chan); return chan; } } @@ -109,8 +108,7 @@ nvkm_fifo_chan_chid(struct nvkm_fifo *fifo, int chid, unsigned long *rflags) spin_lock_irqsave(&fifo->lock, flags); list_for_each_entry(chan, &fifo->chan, head) { if (chan->chid == chid) { - list_del(&chan->head); - list_add(&chan->head, &fifo->chan); + list_move(&chan->head, &fifo->chan); *rflags = flags; return chan; }