public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/27] driver core: Make device_find_child()'s match function take a const pointer
@ 2024-08-11  2:24 Zijun Hu
  2024-08-11  2:24 ` [PATCH 01/27] driver core: Constify driver API device_find_child() Zijun Hu
                   ` (26 more replies)
  0 siblings, 27 replies; 31+ messages in thread
From: Zijun Hu @ 2024-08-11  2:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki; +Cc: Zijun Hu, linux-kernel, Zijun Hu

This patch series is to constify the following core driver 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);

It mainly make various device_find_child()'s match functions take
const void * as match data type.

Why to constify the API?

(1) It does not make sense, also does not need to, for such device
finding operation to modify caller's match data which is mainly
used for comparison.
(2) It will make the API's match function parameter have the same
signature as all other APIs (bus|class|driver)_find_device().

Previous discussion link:
https://lore.kernel.org/lkml/917359cc-a421-41dd-93f4-d28937fe2325@icloud.com

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
Zijun Hu (27):
      driver core: Constify driver API device_find_child()
      Bluetooth: hci_sysfs: Make device_find_child()'s match function take a const pointer
      serial: core: Make device_find_child()'s match function take a const pointer
      usb: typec: class: Make device_find_child()'s match function take a const pointer
      gpio: sim: Make device_find_child()'s match function take a const pointer
      slimbus: core: Make device_find_child()'s match function take a const pointer
      scsi: iscsi: Make device_find_child()'s match function take a const pointer
      scsi: iscsi: Constify driver API iscsi_find_flashnode_sess()
      scsi: qla4xxx: Make iscsi_find_flashnode_sess()'s match function take a const pointer
      pwm: Make device_find_child()'s match function take a const pointer
      media: pci: mgb4: Make device_find_child()'s match function take a const pointer
      range.h: Make range_contains() take const struct range * as parameter type
      cxl/region: Make device_find_child()'s match function take a const pointer
      cxl/pmem: Make device_find_child()'s match function take a const pointer
      cxl/core/pci: Make device_find_child()'s match function take a const pointer
      sparc: vio: Make device_find_child()'s match function take a const pointer
      bus: fsl-mc: Make device_find_child()'s match function take a const pointer
      block: sunvdc: Make device_find_child()'s match function take a const pointer
      firmware: arm_scmi: Make device_find_child()'s match function take a const pointer
      efi: dev-path-parser: Make device_find_child()'s match function take a const pointer
      drm/mediatek: Make device_find_child()'s match function take a const pointer
      nvdimm: Make device_find_child()'s match function take a const pointer
      libnvdimm: Make device_find_child()'s match function take a const pointer
      rpmsg: core: Make device_find_child()'s match function take a const pointer
      thunderbolt: Make device_find_child()'s match function take a const pointer
      net: dsa: Make device_find_child()'s match function take a const pointer
      cxl/test: Make device_find_child()'s match function take a const pointer

 arch/sparc/kernel/vio.c                |  6 +++---
 drivers/base/core.c                    | 11 +++--------
 drivers/block/sunvdc.c                 |  8 ++++----
 drivers/bus/fsl-mc/dprc-driver.c       |  8 ++++----
 drivers/cxl/core/pci.c                 |  4 ++--
 drivers/cxl/core/pmem.c                |  2 +-
 drivers/cxl/core/region.c              | 19 +++++++++++--------
 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/media/pci/mgb4/mgb4_core.c     |  4 ++--
 drivers/nvdimm/bus.c                   |  2 +-
 drivers/nvdimm/claim.c                 |  4 ++--
 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                 | 11 ++++++-----
 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/linux/range.h                  |  3 ++-
 include/scsi/scsi_transport_iscsi.h    |  4 ++--
 net/bluetooth/hci_sysfs.c              |  2 +-
 net/dsa/dsa.c                          |  2 +-
 tools/testing/cxl/test/cxl.c           |  2 +-
 29 files changed, 72 insertions(+), 71 deletions(-)
---
base-commit: bfa54a793ba77ef696755b66f3ac4ed00c7d1248
change-id: 20240811-const_dfc_done-c5c206675c6b
prerequisite-change-id: 20240801-dev_match_api-415a755fcffb:v2
prerequisite-patch-id: 475b810c1ccacab955c654c223d5214f70c4f6c8
prerequisite-change-id: 20240811-const_dfc_prepare-3ff23c6598e5:v1
prerequisite-patch-id: 81a5ccaa144a7732cae29fc5ea1a13426becee5b
prerequisite-patch-id: 9b77254186b7366809f949f5643f9437fa2528a0
prerequisite-patch-id: 95308bb3eedcf8c4a5e30aa3071116148495329e
prerequisite-patch-id: ee643a52674e2aead02f7be3d011d88507970436
prerequisite-patch-id: 0625de1f03ef4350b1828f0faff7a9d9bdebae94

Best regards,
-- 
Zijun Hu <quic_zijuhu@quicinc.com>


^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2024-08-13 10:52 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-11  2:24 [PATCH 00/27] driver core: Make device_find_child()'s match function take a const pointer Zijun Hu
2024-08-11  2:24 ` [PATCH 01/27] driver core: Constify driver API device_find_child() Zijun Hu
2024-08-13  9:48   ` Greg Kroah-Hartman
2024-08-13 10:39     ` quic_zijuhu
2024-08-13 10:52       ` Greg Kroah-Hartman
2024-08-11  2:24 ` [PATCH 02/27] Bluetooth: hci_sysfs: Make device_find_child()'s match function take a const pointer Zijun Hu
2024-08-11  2:24 ` [PATCH 03/27] serial: core: " Zijun Hu
2024-08-11  2:24 ` [PATCH 04/27] usb: typec: class: " Zijun Hu
2024-08-11  2:24 ` [PATCH 05/27] gpio: sim: " Zijun Hu
2024-08-11  2:24 ` [PATCH 06/27] slimbus: core: " Zijun Hu
2024-08-11  2:24 ` [PATCH 07/27] scsi: iscsi: " Zijun Hu
2024-08-11  2:24 ` [PATCH 08/27] scsi: iscsi: Constify driver API iscsi_find_flashnode_sess() Zijun Hu
2024-08-11  2:25 ` [PATCH 09/27] scsi: qla4xxx: Make iscsi_find_flashnode_sess()'s match function take a const pointer Zijun Hu
2024-08-11  2:25 ` [PATCH 10/27] pwm: Make device_find_child()'s " Zijun Hu
2024-08-11  2:25 ` [PATCH 11/27] media: pci: mgb4: " Zijun Hu
2024-08-11  2:25 ` [PATCH 12/27] range.h: Make range_contains() take const struct range * as parameter type Zijun Hu
2024-08-11  2:25 ` [PATCH 13/27] cxl/region: Make device_find_child()'s match function take a const pointer Zijun Hu
2024-08-11  2:25 ` [PATCH 14/27] cxl/pmem: " Zijun Hu
2024-08-11  2:25 ` [PATCH 15/27] cxl/core/pci: " Zijun Hu
2024-08-11  2:25 ` [PATCH 16/27] sparc: vio: " Zijun Hu
2024-08-11  2:25 ` [PATCH 17/27] bus: fsl-mc: " Zijun Hu
2024-08-11  2:25 ` [PATCH 18/27] block: sunvdc: " Zijun Hu
2024-08-11  2:25 ` [PATCH 19/27] firmware: arm_scmi: " Zijun Hu
2024-08-11  2:25 ` [PATCH 20/27] efi: dev-path-parser: " Zijun Hu
2024-08-11  2:25 ` [PATCH 21/27] drm/mediatek: " Zijun Hu
2024-08-11  2:25 ` [PATCH 22/27] nvdimm: " Zijun Hu
2024-08-11  2:25 ` [PATCH 23/27] libnvdimm: " Zijun Hu
2024-08-11  2:25 ` [PATCH 24/27] rpmsg: core: " Zijun Hu
2024-08-11  2:25 ` [PATCH 25/27] thunderbolt: " Zijun Hu
2024-08-11  2:25 ` [PATCH 26/27] net: dsa: " Zijun Hu
2024-08-11  2:25 ` [PATCH 27/27] cxl/test: " Zijun Hu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox