lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240811-const_dfc_done-v1-0-9d85e3f943cb@quicinc.com>
Date: Sun, 11 Aug 2024 10:24:51 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, 
 "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Zijun Hu <zijun_hu@...oud.com>, linux-kernel@...r.kernel.org, 
 Zijun Hu <quic_zijuhu@...cinc.com>
Subject: [PATCH 00/27] driver core: Make device_find_child()'s match
 function take a const pointer

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@...cinc.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@...cinc.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ