[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1643099964-13905-1-git-send-email-zou_wei@huawei.com>
Date: Tue, 25 Jan 2022 16:39:24 +0800
From: Zou Wei <zou_wei@...wei.com>
To: <zhenyuw@...ux.intel.com>, <zhi.a.wang@...el.com>,
<jani.nikula@...ux.intel.com>, <joonas.lahtinen@...ux.intel.com>,
<rodrigo.vivi@...el.com>, <tvrtko.ursulin@...ux.intel.com>,
<airlied@...ux.ie>, <daniel@...ll.ch>
CC: <intel-gvt-dev@...ts.freedesktop.org>,
<intel-gfx@...ts.freedesktop.org>,
<dri-devel@...ts.freedesktop.org>, <linux-kernel@...r.kernel.org>,
Zou Wei <zou_wei@...wei.com>
Subject: [PATCH -next] drm/i915/gvt: Convert list_for_each to entry variant
convert list_for_each() to list_for_each_entry() where
applicable.
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Zou Wei <zou_wei@...wei.com>
---
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;
--
2.6.2
Powered by blists - more mailing lists