public inbox for linux-cxl@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jonathan.cameron@huawei.com>
To: <alejandro.lucero-palau@amd.com>
Cc: <linux-cxl@vger.kernel.org>, <dan.j.williams@intel.com>,
	<dave.jiang@intel.com>, <gourry@gourry.net>,
	Alejandro Lucero <alucerop@amd.com>
Subject: Re: [PATCH v3 4/4] cxl/pci: Remove redundant cxl_pci_find_port() call
Date: Mon, 2 Mar 2026 15:21:09 +0000	[thread overview]
Message-ID: <20260302152109.0000707d@huawei.com> (raw)
In-Reply-To: <20260228172549.1121832-5-alejandro.lucero-palau@amd.com>

On Sat, 28 Feb 2026 17:25:49 +0000
alejandro.lucero-palau@amd.com wrote:

> From: Alejandro Lucero <alucerop@amd.com>
Needs to match the sign-off.

git commit --amend --author="Gregory Price <gourry@gourry.net>"
Should fix that up for you.

> 
> Remove the redundant port lookup from cxl_rcrb_get_comp_regs() and use the
> dport parameter directly. The caller has already validated the port is
> non-NULL before invoking this function.

Given the existing caller only does this immediately before the function call,
what the reasoning for dropping this one rather than dropping the one in
cxl_pci_setup_regs() which would have the same effect?  I'm fine with doing
it here, but needs a tiny bit more descriptive text.  With that added and
the author fixed up

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>


> 
> Signed-off-by: Gregory Price <gourry@gourry.net>
> Reviewed-by: Alejandro Lucero <alucerop@amd.com>
> ---
>  drivers/cxl/core/pci.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c
> index c32cc62c501d..d1f487b3d809 100644
> --- a/drivers/cxl/core/pci.c
> +++ b/drivers/cxl/core/pci.c
> @@ -707,11 +707,6 @@ static int cxl_rcrb_get_comp_regs(struct pci_dev *pdev,
>  		.resource = CXL_RESOURCE_NONE,
>  	};
>  
> -	struct cxl_port *port __free(put_cxl_port) =
> -		cxl_pci_find_port(pdev, &dport);
> -	if (!port)
> -		return -EPROBE_DEFER;
> -
>  	component_reg_phys = cxl_rcd_component_reg_phys(&pdev->dev, dport);
>  	if (component_reg_phys == CXL_RESOURCE_NONE)
>  		return -ENXIO;


  reply	other threads:[~2026-03-02 15:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-28 17:25 [PATCH v3 0/4] type2 support preparation alejandro.lucero-palau
2026-02-28 17:25 ` [PATCH v3 1/4] cxl: support Type2 when initializing cxl_dev_state alejandro.lucero-palau
2026-02-28 17:25 ` [PATCH v3 2/4] cxl: export internal structs for external Type2 drivers alejandro.lucero-palau
2026-02-28 17:25 ` [PATCH v3 3/4] cxl: Move pci generic code alejandro.lucero-palau
2026-02-28 17:25 ` [PATCH v3 4/4] cxl/pci: Remove redundant cxl_pci_find_port() call alejandro.lucero-palau
2026-03-02 15:21   ` Jonathan Cameron [this message]
2026-03-06 15:35     ` Alejandro Lucero Palau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260302152109.0000707d@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=alejandro.lucero-palau@amd.com \
    --cc=alucerop@amd.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=gourry@gourry.net \
    --cc=linux-cxl@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox