[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9d2de147-8fc6-419f-bf3e-03f6b86cbb44@icloud.com>
Date: Fri, 6 Dec 2024 09:02:58 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Alison Schofield <alison.schofield@...el.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Uwe Kleine-König <ukleinek@...nel.org>,
James Bottomley <James.Bottomley@...senpartnership.com>,
Thomas Weißschuh <thomas@...ch.de>,
linux-kernel@...r.kernel.org, nvdimm@...ts.linux.dev,
linux-sound@...r.kernel.org, sparclinux@...r.kernel.org,
linux-block@...r.kernel.org, linux-cxl@...r.kernel.org,
linux1394-devel@...ts.sourceforge.net, arm-scmi@...r.kernel.org,
linux-efi@...r.kernel.org, linux-gpio@...r.kernel.org,
dri-devel@...ts.freedesktop.org, linux-mediatek@...ts.infradead.org,
linux-hwmon@...r.kernel.org, linux-media@...r.kernel.org,
linux-pwm@...r.kernel.org, linux-remoteproc@...r.kernel.org,
linux-scsi@...r.kernel.org, open-iscsi@...glegroups.com,
linux-usb@...r.kernel.org, linux-serial@...r.kernel.org,
netdev@...r.kernel.org, Zijun Hu <quic_zijuhu@...cinc.com>
Subject: Re: [PATCH v3 10/11] cxl/pmem: Remove match_nvdimm_bridge()
On 2024/12/6 06:49, Alison Schofield wrote:
> On Thu, Dec 05, 2024 at 08:10:19AM +0800, Zijun Hu wrote:
>> From: Zijun Hu <quic_zijuhu@...cinc.com>
>
> Suggest conveying more detail in the commit msg:
>
> cxl/pmem> Replace match_nvdimm_bridge() w device_match_type()
>
good suggestions
will take it in v4.
>>
>> match_nvdimm_bridge(), as matching function of device_find_child(), is to
>> match a device with device type @cxl_nvdimm_bridge_type, and is unnecessary
>
> Prefer being clear that this function recently become needless.
> Something like:
>
> match_nvdimm_bridge(), as matching function of device_find_child(),
> matches a device with device type @cxl_nvdimm_bridge_type. The recently
> added API, device_match_type, simplifies that task.
>
> Replace match_nvdimm_bridge() usage with device_match_type().
>
sure. will do it in v4 by following these good comments.
> With that you can add:
>
> Reviewed-by: Alison Schofield <alison.schofield@...el.com>
>
>>
>> Signed-off-by: Zijun Hu <quic_zijuhu@...cinc.com>
>> ---
>> drivers/cxl/core/pmem.c | 9 +++------
>> 1 file changed, 3 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/cxl/core/pmem.c b/drivers/cxl/core/pmem.c
>> index a8473de24ebfd92f12f47e0556e28b81a29cff7c..0f8166e793e14fc0b1c04ffda79e756a743d9e6b 100644
>> --- a/drivers/cxl/core/pmem.c
>> +++ b/drivers/cxl/core/pmem.c
>> @@ -57,11 +57,6 @@ bool is_cxl_nvdimm_bridge(struct device *dev)
>> }
>> EXPORT_SYMBOL_NS_GPL(is_cxl_nvdimm_bridge, "CXL");
>>
>> -static int match_nvdimm_bridge(struct device *dev, const void *data)
>> -{
>> - return is_cxl_nvdimm_bridge(dev);
>> -}
>> -
>> /**
>> * cxl_find_nvdimm_bridge() - find a bridge device relative to a port
>> * @port: any descendant port of an nvdimm-bridge associated
>> @@ -75,7 +70,9 @@ struct cxl_nvdimm_bridge *cxl_find_nvdimm_bridge(struct cxl_port *port)
>> if (!cxl_root)
>> return NULL;
>>
>> - dev = device_find_child(&cxl_root->port.dev, NULL, match_nvdimm_bridge);
>> + dev = device_find_child(&cxl_root->port.dev,
>> + &cxl_nvdimm_bridge_type,
>> + device_match_type);
>>
>> if (!dev)
>> return NULL;
>>
>> --
>> 2.34.1
>>
>>
Powered by blists - more mailing lists