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

From: Thomas Gleixner
Date: Wed Nov 20 2019 - 13:06:03 EST


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@xxxxxxxxxxxxx>