Re: [PATCH v2 03/15] cxl/region: Factor out code for interleaving calculations

Gregory Price
2025-02-20T16:41:12Z

On Thu, Feb 20, 2025 at 11:28:40AM -0500, Gregory Price wrote:
> On Tue, Feb 18, 2025 at 02:23:44PM +0100, Robert Richter wrote:
> I get that this will be used later to pass information back, but this
> patch by itself is a little confusing because ctx seems pointless since
> the function still returns the position and accesses the hpa_range directly
>
> Looked at in isolation, having the context structure change in this
> patch than just adding the hpa_range as an argument and adding the
> context later when it's actually relevant.
>
> static int cxl_port_calc_interleave(struct cxl_port *port,
> struct range *hpa_range);
>

Disregard my note here, I missed that pos has to be carried through.

Didn't notice until I looked at patch 3 and 4 together.

> + ctx->pos = ctx->pos * parent_ways + parent_pos;
> +
> + return ctx->pos;

This looks fine

Reviewed-by: Gregory Price <gourry@gourry.net>