Re: [PATCH 3/3] drm: Skip initialising the drm_mm_node->hole_stack

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Chris

On Wed, Aug 3, 2016 at 5:04 PM, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> wrote:
> As we always add this to the drm_mm->hole_stack as our first operation,
> we do not need to initialise the list node.
>
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: David Herrmann <dh.herrmann@xxxxxxxxx>
> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> ---
>  drivers/gpu/drm/drm_mm.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)

"hole_follows" tells whether it is linked or not. So yeah, indeed, redundant.

Reviewed-by: David Herrmann <dh.herrmann@xxxxxxxxx>

Thanks
David

> diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c
> index 5c188c56894b..3f56d4b0cdae 100644
> --- a/drivers/gpu/drm/drm_mm.c
> +++ b/drivers/gpu/drm/drm_mm.c
> @@ -217,7 +217,6 @@ static void drm_mm_insert_helper(struct drm_mm_node *hole_node,
>         node->color = color;
>         node->allocated = 1;
>
> -       INIT_LIST_HEAD(&node->hole_stack);
>         list_add(&node->node_list, &hole_node->node_list);
>
>         drm_mm_interval_tree_add_node(hole_node, node);
> @@ -276,14 +275,13 @@ int drm_mm_reserve_node(struct drm_mm *mm, struct drm_mm_node *node)
>         node->mm = mm;
>         node->allocated = 1;
>
> -       INIT_LIST_HEAD(&node->hole_stack);
>         list_add(&node->node_list, &hole->node_list);
>
>         drm_mm_interval_tree_add_node(hole, node);
>
>         if (node->start == hole_start) {
>                 hole->hole_follows = 0;
> -               list_del_init(&hole->hole_stack);
> +               list_del(&hole->hole_stack);
>         }
>
>         node->hole_follows = 0;
> @@ -379,7 +377,6 @@ static void drm_mm_insert_helper_range(struct drm_mm_node *hole_node,
>         node->color = color;
>         node->allocated = 1;
>
> -       INIT_LIST_HEAD(&node->hole_stack);
>         list_add(&node->node_list, &hole_node->node_list);
>
>         drm_mm_interval_tree_add_node(hole_node, node);
> @@ -833,7 +830,6 @@ void drm_mm_init(struct drm_mm * mm, u64 start, u64 size)
>
>         /* Clever trick to avoid a special case in the free hole tracking. */
>         INIT_LIST_HEAD(&mm->head_node.node_list);
> -       INIT_LIST_HEAD(&mm->head_node.hole_stack);
>         mm->head_node.hole_follows = 1;
>         mm->head_node.scanned_block = 0;
>         mm->head_node.scanned_prev_free = 0;
> --
> 2.8.1
>
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux