From: Geliang Tang Date: Tue, 20 Dec 2016 14:02:11 +0000 (+0800) Subject: drm/nouveau/dma: use rb_entry() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=05073caeedd1ea6bfc5b1ebd051f2a6694e4b26b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm/nouveau/dma: use rb_entry() To make the code clearer, use rb_entry() instead of container_of() to deal with rbtree. Signed-off-by: Geliang Tang Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c index f11ebdd16c77..4655d1750b95 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/dma/base.c @@ -34,7 +34,7 @@ nvkm_dma_search(struct nvkm_dma *dma, struct nvkm_client *client, u64 object) struct rb_node *node = client->dmaroot.rb_node; while (node) { struct nvkm_dmaobj *dmaobj = - container_of(node, typeof(*dmaobj), rb); + rb_entry(node, typeof(*dmaobj), rb); if (object < dmaobj->handle) node = node->rb_left; else @@ -67,7 +67,7 @@ nvkm_dma_oclass_new(struct nvkm_device *device, dmaobj->handle = oclass->object; while (*ptr) { - struct nvkm_dmaobj *obj = container_of(*ptr, typeof(*obj), rb); + struct nvkm_dmaobj *obj = rb_entry(*ptr, typeof(*obj), rb); parent = *ptr; if (dmaobj->handle < obj->handle) ptr = &parent->rb_left;