From patchwork Tue Jan 25 08:39:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zou Wei X-Patchwork-Id: 12723570 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BEAFDC433F5 for ; Tue, 25 Jan 2022 09:30:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3DA2110E532; Tue, 25 Jan 2022 09:30:22 +0000 (UTC) X-Greylist: delayed 1056 seconds by postgrey-1.36 at gabe; Tue, 25 Jan 2022 08:57:10 UTC Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by gabe.freedesktop.org (Postfix) with ESMTPS id DB83810EE10; Tue, 25 Jan 2022 08:57:10 +0000 (UTC) Received: from kwepemi100018.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4JjgGr2YR5z9sJ5; Tue, 25 Jan 2022 16:38:12 +0800 (CST) Received: from kwepemm600013.china.huawei.com (7.193.23.68) by kwepemi100018.china.huawei.com (7.221.188.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 25 Jan 2022 16:39:31 +0800 Received: from linux-lmwb.huawei.com (10.175.103.112) by kwepemm600013.china.huawei.com (7.193.23.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 25 Jan 2022 16:39:30 +0800 From: Zou Wei To: , , , , , , , Date: Tue, 25 Jan 2022 16:39:24 +0800 Message-ID: <1643099964-13905-1-git-send-email-zou_wei@huawei.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 X-Originating-IP: [10.175.103.112] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600013.china.huawei.com (7.193.23.68) X-CFilter-Loop: Reflected X-Mailman-Approved-At: Tue, 25 Jan 2022 09:30:18 +0000 Subject: [Intel-gfx] [PATCH -next] drm/i915/gvt: Convert list_for_each to entry variant X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Zou Wei Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" convert list_for_each() to list_for_each_entry() where applicable. Reported-by: Hulk Robot Signed-off-by: Zou Wei --- drivers/gpu/drm/i915/gvt/dmabuf.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/dmabuf.c b/drivers/gpu/drm/i915/gvt/dmabuf.c index 8882843..1f0721d 100644 --- a/drivers/gpu/drm/i915/gvt/dmabuf.c +++ b/drivers/gpu/drm/i915/gvt/dmabuf.c @@ -350,13 +350,11 @@ static struct intel_vgpu_dmabuf_obj * pick_dmabuf_by_info(struct intel_vgpu *vgpu, struct intel_vgpu_fb_info *latest_info) { - struct list_head *pos; struct intel_vgpu_fb_info *fb_info; struct intel_vgpu_dmabuf_obj *dmabuf_obj = NULL; struct intel_vgpu_dmabuf_obj *ret = NULL; - list_for_each(pos, &vgpu->dmabuf_obj_list_head) { - dmabuf_obj = list_entry(pos, struct intel_vgpu_dmabuf_obj, list); + list_for_each_entry(dmabuf_obj, &vgpu->dmabuf_obj_list_head, list) { if (!dmabuf_obj->info) continue; @@ -379,12 +377,10 @@ pick_dmabuf_by_info(struct intel_vgpu *vgpu, static struct intel_vgpu_dmabuf_obj * pick_dmabuf_by_num(struct intel_vgpu *vgpu, u32 id) { - struct list_head *pos; struct intel_vgpu_dmabuf_obj *dmabuf_obj = NULL; struct intel_vgpu_dmabuf_obj *ret = NULL; - list_for_each(pos, &vgpu->dmabuf_obj_list_head) { - dmabuf_obj = list_entry(pos, struct intel_vgpu_dmabuf_obj, list); + list_for_each_entry(dmabuf_obj, &vgpu->dmabuf_obj_list_head, list) { if (dmabuf_obj->dmabuf_id == id) { ret = dmabuf_obj; break;