diff mbox series

[v2,08/14] cxl/pci: Change find_cxl_ports() to non-static

Message ID 20241025210305.27499-9-terry.bowman@amd.com
State New
Headers show
Series Enable CXL PCIe port protocol error handling and logging | expand

Commit Message

Bowman, Terry Oct. 25, 2024, 9:02 p.m. UTC
CXL PCIe port protocol error support will be added in the future. This
requires searching for a CXL PCIe port device in the CXL topology as
provided by find_cxl_port(). But, find_cxl_port() is defined static
and as a result is not callable outside of this source file.

Update the find_cxl_port() declaration to be non-static.

Signed-off-by: Terry Bowman <terry.bowman@amd.com>
---
 drivers/cxl/core/core.h | 3 +++
 drivers/cxl/core/port.c | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

Comments

Jonathan Cameron Oct. 30, 2024, 3:45 p.m. UTC | #1
On Fri, 25 Oct 2024 16:02:59 -0500
Terry Bowman <terry.bowman@amd.com> wrote:

Typo in title. Shouldn't be plural ports.


> CXL PCIe port protocol error support will be added in the future. This
> requires searching for a CXL PCIe port device in the CXL topology as
> provided by find_cxl_port(). But, find_cxl_port() is defined static
> and as a result is not callable outside of this source file.
> 
> Update the find_cxl_port() declaration to be non-static.
> 
> Signed-off-by: Terry Bowman <terry.bowman@amd.com>
Doesn't hugely matter but I'd do this later in the series as it's
not used until patch 12 (I think) and by then reviewers may have forgotten what
it is for.

Fine otherwise,

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

> ---
>  drivers/cxl/core/core.h | 3 +++
>  drivers/cxl/core/port.c | 4 ++--
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cxl/core/core.h b/drivers/cxl/core/core.h
> index 0c62b4069ba0..d81e5ee25f58 100644
> --- a/drivers/cxl/core/core.h
> +++ b/drivers/cxl/core/core.h
> @@ -110,4 +110,7 @@ bool cxl_need_node_perf_attrs_update(int nid);
>  int cxl_port_get_switch_dport_bandwidth(struct cxl_port *port,
>  					struct access_coordinate *c);
>  
> +struct cxl_port *find_cxl_port(struct device *dport_dev,
> +			       struct cxl_dport **dport);
> +
>  #endif /* __CXL_CORE_H__ */
> diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
> index e666ec6a9085..2ac835cd4f1b 100644
> --- a/drivers/cxl/core/port.c
> +++ b/drivers/cxl/core/port.c
> @@ -1342,8 +1342,8 @@ static struct cxl_port *__find_cxl_port(struct cxl_find_port_ctx *ctx)
>  	return NULL;
>  }
>  
> -static struct cxl_port *find_cxl_port(struct device *dport_dev,
> -				      struct cxl_dport **dport)
> +struct cxl_port *find_cxl_port(struct device *dport_dev,
> +			       struct cxl_dport **dport)
>  {
>  	struct cxl_find_port_ctx ctx = {
>  		.dport_dev = dport_dev,
Bowman, Terry Oct. 30, 2024, 3:54 p.m. UTC | #2
Hi Jonathan,

I added comments below.

On 10/30/2024 10:45 AM, Jonathan Cameron wrote:
> On Fri, 25 Oct 2024 16:02:59 -0500
> Terry Bowman <terry.bowman@amd.com> wrote:
>
> Typo in title. Shouldn't be plural ports.

I'll remove the plural. Thanks.

>> CXL PCIe port protocol error support will be added in the future. This
>> requires searching for a CXL PCIe port device in the CXL topology as
>> provided by find_cxl_port(). But, find_cxl_port() is defined static
>> and as a result is not callable outside of this source file.
>>
>> Update the find_cxl_port() declaration to be non-static.
>>
>> Signed-off-by: Terry Bowman <terry.bowman@amd.com>
> Doesn't hugely matter but I'd do this later in the series as it's
> not used until patch 12 (I think) and by then reviewers may have forgotten what
> it is for.
>
> Fine otherwise,
>
> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Thanks. I will move this patch to later.

Regards,
Terry
diff mbox series

Patch

diff --git a/drivers/cxl/core/core.h b/drivers/cxl/core/core.h
index 0c62b4069ba0..d81e5ee25f58 100644
--- a/drivers/cxl/core/core.h
+++ b/drivers/cxl/core/core.h
@@ -110,4 +110,7 @@  bool cxl_need_node_perf_attrs_update(int nid);
 int cxl_port_get_switch_dport_bandwidth(struct cxl_port *port,
 					struct access_coordinate *c);
 
+struct cxl_port *find_cxl_port(struct device *dport_dev,
+			       struct cxl_dport **dport);
+
 #endif /* __CXL_CORE_H__ */
diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c
index e666ec6a9085..2ac835cd4f1b 100644
--- a/drivers/cxl/core/port.c
+++ b/drivers/cxl/core/port.c
@@ -1342,8 +1342,8 @@  static struct cxl_port *__find_cxl_port(struct cxl_find_port_ctx *ctx)
 	return NULL;
 }
 
-static struct cxl_port *find_cxl_port(struct device *dport_dev,
-				      struct cxl_dport **dport)
+struct cxl_port *find_cxl_port(struct device *dport_dev,
+			       struct cxl_dport **dport)
 {
 	struct cxl_find_port_ctx ctx = {
 		.dport_dev = dport_dev,