[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7780942a-93cd-4508-be97-fc5e5267c389@icloud.com>
Date: Sun, 8 Dec 2024 21:18:54 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: 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 04/11] driver core: Constify API device_find_child()
then adapt for various usages
On 2024/12/6 21:52, Takashi Sakamoto wrote:
> Hi,
>
> On Thu, Dec 05, 2024 at 08:10:13AM +0800, Zijun Hu wrote:
>> From: Zijun Hu <quic_zijuhu@...cinc.com>
>>
>> Constify the following API:
>> struct device *device_find_child(struct device *dev, void *data,
>> int (*match)(struct device *dev, void *data));
>> To :
>> struct device *device_find_child(struct device *dev, const void *data,
>> device_match_t match);
>> typedef int (*device_match_t)(struct device *dev, const void *data);
>> with the following reasons:
>>
>> - Protect caller's match data @*data which is for comparison and lookup
>> and the API does not actually need to modify @*data.
>>
>> - Make the API's parameters (@match)() and @data have the same type as
>> all of other device finding APIs (bus|class|driver)_find_device().
>>
>> - All kinds of existing device match functions can be directly taken
>> as the API's argument, they were exported by driver core.
>>
>> Constify the API and adapt for various existing usages by simply making
>> various match functions take 'const void *' as type of match data @data.
>>
>> Signed-off-by: Zijun Hu <quic_zijuhu@...cinc.com>
>> ---
>> arch/sparc/kernel/vio.c | 6 +++---
>> drivers/base/core.c | 6 +++---
>> drivers/block/sunvdc.c | 6 +++---
>> drivers/bus/fsl-mc/dprc-driver.c | 4 ++--
>> drivers/cxl/core/pci.c | 4 ++--
>> drivers/cxl/core/pmem.c | 2 +-
>> drivers/cxl/core/region.c | 21 ++++++++++++---------
>> drivers/firewire/core-device.c | 4 ++--
>> drivers/firmware/arm_scmi/bus.c | 4 ++--
>> drivers/firmware/efi/dev-path-parser.c | 4 ++--
>> drivers/gpio/gpio-sim.c | 2 +-
>> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 2 +-
>> drivers/hwmon/hwmon.c | 2 +-
>> drivers/media/pci/mgb4/mgb4_core.c | 4 ++--
>> drivers/nvdimm/bus.c | 2 +-
>> drivers/pwm/core.c | 2 +-
>> drivers/rpmsg/rpmsg_core.c | 4 ++--
>> drivers/scsi/qla4xxx/ql4_os.c | 3 ++-
>> drivers/scsi/scsi_transport_iscsi.c | 10 +++++-----
>> drivers/slimbus/core.c | 8 ++++----
>> drivers/thunderbolt/retimer.c | 2 +-
>> drivers/thunderbolt/xdomain.c | 2 +-
>> drivers/tty/serial/serial_core.c | 4 ++--
>> drivers/usb/typec/class.c | 8 ++++----
>> include/linux/device.h | 4 ++--
>> include/scsi/scsi_transport_iscsi.h | 4 ++--
>> net/dsa/dsa.c | 2 +-
>> tools/testing/cxl/test/cxl.c | 2 +-
>> 28 files changed, 66 insertions(+), 62 deletions(-)
>
> For the changes in FireWire subsystem:
>
> Reviewed-by: Takashi Sakamoto <o-takashi@...amocchi.jp>
>
thank you for code review and previous cooperation to achieve
this goal (^^).
>
> Thanks
>
> Takashi Sakamoto
Powered by blists - more mailing lists