Re: [PATCH v3 02/18] cxl/pci: Moving code in cxl_hdm_decode_init()
From: Jonathan Cameron
Date: Wed Feb 12 2025 - 12:57:33 EST
On Tue, 11 Feb 2025 10:53:32 +0100
Robert Richter <rrichter@xxxxxxx> 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>
Seems reasonable.
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>