Re: [PATCH v4 02/14] cxl/pci: Moving code in cxl_hdm_decode_init()

From: Alison Schofield
Date: Tue Apr 15 2025 - 17:29:53 EST


On Thu, Mar 06, 2025 at 05:44:36PM +0100, Robert Richter wrote:
> Commit 3f9e07531778 ("cxl/pci: simplify the check of mem_enabled in
> cxl_hdm_decode_init()") changed the code flow in this function. The
> root port is determined before a check to leave the function. Since
> the root port is not used by the check it can be moved to run the
> check first. This improves code readability and avoids unnesessary
> code execution.
>
> Signed-off-by: Robert Richter <rrichter@xxxxxxx>
> Reviewed-by: Gregory Price <gourry@xxxxxxxxxx>
> Reviewed-by: Davidlohr Bueso <dave@xxxxxxxxxxxx>
> Tested-by: Gregory Price <gourry@xxxxxxxxxx>
> ---

Reviewed-by: Alison Schofield <alison.schofield@xxxxxxxxx>