On 01/21/2017 12:36 AM, Geliang Tang wrote:
> To make the code clearer, use rb_entry() instead of container_of() to
> deal with rbtree.
Hey Geliang,

Looks good, however, I've already got a patch handling this pending in
my tree.

Thank you!
Ben.

> 
> Signed-off-by: Geliang Tang <[email protected]>
> ---
>  drivers/gpu/drm/nouveau/nvkm/core/client.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/core/client.c 
> b/drivers/gpu/drm/nouveau/nvkm/core/client.c
> index e194391..ab2ee14 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/core/client.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/core/client.c
> @@ -221,7 +221,7 @@ nvkm_client_insert(struct nvkm_client *client, struct 
> nvkm_object *object)
>  
>       while (*ptr) {
>               struct nvkm_object *this =
> -                     container_of(*ptr, typeof(*this), node);
> +                     rb_entry(*ptr, typeof(*this), node);
>               parent = *ptr;
>               if (object->object < this->object)
>                       ptr = &parent->rb_left;
> @@ -243,7 +243,7 @@ nvkm_client_search(struct nvkm_client *client, u64 handle)
>       struct rb_node *node = client->objroot.rb_node;
>       while (node) {
>               struct nvkm_object *object =
> -                     container_of(node, typeof(*object), node);
> +                     rb_entry(node, typeof(*object), node);
>               if (handle < object->object)
>                       node = node->rb_left;
>               else
> 

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

Reply via email to