Re: [PATCH 1/4] x86/mm, pat: Convert pat tree to generic interval tree

Thomas Gleixner
2019-11-20T18:06:02Z

On Mon, 21 Oct 2019, Davidlohr Bueso wrote:
> int rbt_memtype_check_insert(struct memtype *new,
> enum page_cache_mode *ret_type)
> {
> int err = 0;
>
> err = memtype_rb_check_conflict(&memtype_rbroot, new->start, new->end,
> - new->type, ret_type);
> -
> - if (!err) {
> - if (ret_type)
> - new->type = *ret_type;
> -
> - new->subtree_max_end = new->end;
> - memtype_rb_insert(&memtype_rbroot, new);
> - }
> + new->type, ret_type);
> + if (err)
> + goto done;

Please return err here. That goto is pointless.

> +
> + if (ret_type)
> + new->type = *ret_type;
> + memtype_interval_insert(new, &memtype_rbroot);
> +done:
> return err;
> }

Other than that.

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>