Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit b547388

Browse files
committed
Merge remote-tracking branch 'origin/gvt-next' into gvt-staging
2 parents aaa5758 + 428c051 commit b547388

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

drivers/gpu/drm/i915/gvt/dmabuf.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ static void dmabuf_gem_object_free(struct kref *kref)
148148

149149
if (vgpu && vgpu->active && !list_empty(&vgpu->dmabuf_obj_list_head)) {
150150
list_for_each(pos, &vgpu->dmabuf_obj_list_head) {
151-
dmabuf_obj = container_of(pos,
152-
struct intel_vgpu_dmabuf_obj, list);
151+
dmabuf_obj = list_entry(pos, struct intel_vgpu_dmabuf_obj, list);
153152
if (dmabuf_obj == obj) {
154153
list_del(pos);
155154
intel_gvt_hypervisor_put_vfio_device(vgpu);
@@ -357,10 +356,8 @@ pick_dmabuf_by_info(struct intel_vgpu *vgpu,
357356
struct intel_vgpu_dmabuf_obj *ret = NULL;
358357

359358
list_for_each(pos, &vgpu->dmabuf_obj_list_head) {
360-
dmabuf_obj = container_of(pos, struct intel_vgpu_dmabuf_obj,
361-
list);
362-
if ((dmabuf_obj == NULL) ||
363-
(dmabuf_obj->info == NULL))
359+
dmabuf_obj = list_entry(pos, struct intel_vgpu_dmabuf_obj, list);
360+
if (!dmabuf_obj->info)
364361
continue;
365362

366363
fb_info = (struct intel_vgpu_fb_info *)dmabuf_obj->info;
@@ -387,11 +384,7 @@ pick_dmabuf_by_num(struct intel_vgpu *vgpu, u32 id)
387384
struct intel_vgpu_dmabuf_obj *ret = NULL;
388385

389386
list_for_each(pos, &vgpu->dmabuf_obj_list_head) {
390-
dmabuf_obj = container_of(pos, struct intel_vgpu_dmabuf_obj,
391-
list);
392-
if (!dmabuf_obj)
393-
continue;
394-
387+
dmabuf_obj = list_entry(pos, struct intel_vgpu_dmabuf_obj, list);
395388
if (dmabuf_obj->dmabuf_id == id) {
396389
ret = dmabuf_obj;
397390
break;
@@ -600,8 +593,7 @@ void intel_vgpu_dmabuf_cleanup(struct intel_vgpu *vgpu)
600593

601594
mutex_lock(&vgpu->dmabuf_lock);
602595
list_for_each_safe(pos, n, &vgpu->dmabuf_obj_list_head) {
603-
dmabuf_obj = container_of(pos, struct intel_vgpu_dmabuf_obj,
604-
list);
596+
dmabuf_obj = list_entry(pos, struct intel_vgpu_dmabuf_obj, list);
605597
dmabuf_obj->vgpu = NULL;
606598

607599
idr_remove(&vgpu->object_idr, dmabuf_obj->dmabuf_id);

0 commit comments

Comments
 (0)