mbox series

[v3,00/80] Constify most SCSI host templates

Message ID 20230322195515.1267197-1-bvanassche@acm.org
Headers show
Series Constify most SCSI host templates | expand

Message

Bart Van Assche March 22, 2023, 7:53 p.m. UTC
Hi Martin,

It helps humans and the compiler if it is made explicit that SCSI host
templates are not modified. Hence this patch series that constifies most
SCSI host templates. Please consider this patch series for the next merge
window.

Thanks,

Bart.

Changes compared to v2:
- Dropped the mac_scsi patch.
- Dropped patch "scsi: core: Update a source code comment"

Changes compared to v1:
- Simplified the qla2xxx patch as requested by John Garry.
- Removed a file from the ata patch that was added accidentally.
- Extracted the isci changes from the iscsi patch and moved these into a
  separate patch.
- Added Reviewed-by / Acked-by tags.

Bart Van Assche (80):
  scsi: qla2xxx: Refer directly to the qla2xxx_driver_template
  scsi: core: Declare most SCSI host template pointers const
  scsi: core: Declare SCSI host template pointer members const
  ata: Declare SCSI host templates const
  firewire: sbp2: Declare the SCSI host template const
  RDMA/srp: Declare the SCSI host template const
  scsi: message: fusion: Declare SCSI host template members const
  scsi: zfcp: Declare SCSI host template const
  scsi: 3w-9xxx: Declare SCSI host template const
  scsi: 3w-sas: Declare SCSI host template const
  scsi: 3w-xxxx: Declare SCSI host template const
  scsi: BusLogic: Declare SCSI host template const
  scsi: a100u2w: Declare SCSI host template const
  scsi: a2091: Declare SCSI host template const
  scsi: a3000: Declare SCSI host template const
  scsi: aacraid: Declare SCSI host template const
  scsi: advansys: Declare SCSI host template const
  scsi: aha152x: Declare SCSI host template const
  scsi: aha1542: Declare SCSI host template const
  scsi: aic94xx: Declare SCSI host template const
  scsi: arcmsr: Declare SCSI host template const
  scsi: acornscsi: Declare SCSI host template const
  scsi: arxescsi: Declare SCSI host template const
  scsi: aha1740: Declare SCSI host template const
  scsi: cumana: Declare SCSI host template const
  scsi: eesox: Declare SCSI host template const
  scsi: oak: Declare SCSI host template const
  scsi: powertec: Declare SCSI host template const
  scsi: atp870u: Declare SCSI host template const
  scsi: dc395x: Declare SCSI host template const
  scsi: dmx3191d: Declare SCSI host template const
  scsi: elx: efct: Declare SCSI host template const
  scsi: esas2r: Declare SCSI host template const
  scsi: esp_scsi: Declare SCSI host template const
  scsi: fcoe: Declare SCSI host template const
  scsi: fnic: Declare host template const
  scsi: qedf: Declare host template const
  scsi: fdomain: Declare SCSI host template const
  scsi: NCR5380: Declare SCSI host template const
  scsi: gvp11: Declare SCSI host template const
  scsi: hisi_sas: Declare SCSI host template const
  scsi: hpsa: Declare SCSI host template const
  scsi: hptiop: Declare SCSI host template const
  scsi: ibmvfc: Declare SCSI host template const
  scsi: imm: Declare SCSI host template const
  scsi: initio: Declare SCSI host template const
  scsi: ipr: Declare SCSI host template const
  scsi: isci: Declare SCSI host template const
  scsi: iscsi: Declare SCSI host template const
  scsi: mac53c94: Declare SCSI host template const
  scsi: megaraid: Declare SCSI host template const
  scsi: mesh: Declare SCSI host template const
  scsi: mpi3mr: Declare SCSI host template const
  scsi: mpt3sas: Declare SCSI host template const
  scsi: mvme147: Declare SCSI host template const
  scsi: mvsas: Declare SCSI host template const
  scsi: mvumi: Declare SCSI host template const
  scsi: myrb: Declare SCSI host template const
  scsi: myrs: Declare SCSI host template const
  scsi: nsp32: Declare SCSI host template const
  scsi: pcmcia-sym53c500: Declare SCSI host template const
  scsi: pcmcia-pm8001: Declare SCSI host template const
  scsi: pmcraid: Declare SCSI host template const
  scsi: ppa: Declare SCSI host template const
  scsi: ps3rom: Declare SCSI host template const
  scsi: qla1280: Declare SCSI host template const
  scsi: qla2xxx: Declare SCSI host template const
  scsi: qlogicpti: Declare SCSI host template const
  scsi: sgiwd93: Declare SCSI host template const
  scsi: smartpqi: Declare SCSI host template const
  scsi: snic: Declare SCSI host template const
  scsi: stex: Declare SCSI host template const
  scsi: sym53c8xx: Declare SCSI host template const
  scsi: virtio-scsi: Declare SCSI host template const
  scsi: wd719x: Declare SCSI host template const
  scsi: xen-scsifront: Declare SCSI host template const
  scsi: rts5208: Declare SCSI host template const
  scsi: target: tcm-loop: Declare SCSI host template const
  scsi: ufs: Declare SCSI host template const
  usb: uas: Declare two host templates and host template pointers const

 Documentation/scsi/scsi_mid_low_api.rst   |  2 +-
 drivers/ata/acard-ahci.c                  |  2 +-
 drivers/ata/ahci.c                        |  2 +-
 drivers/ata/ahci.h                        |  2 +-
 drivers/ata/ahci_brcm.c                   |  2 +-
 drivers/ata/ahci_ceva.c                   |  2 +-
 drivers/ata/ahci_da850.c                  |  2 +-
 drivers/ata/ahci_dm816.c                  |  2 +-
 drivers/ata/ahci_dwc.c                    |  2 +-
 drivers/ata/ahci_imx.c                    |  2 +-
 drivers/ata/ahci_mtk.c                    |  2 +-
 drivers/ata/ahci_mvebu.c                  |  2 +-
 drivers/ata/ahci_platform.c               |  2 +-
 drivers/ata/ahci_qoriq.c                  |  2 +-
 drivers/ata/ahci_seattle.c                |  2 +-
 drivers/ata/ahci_st.c                     |  2 +-
 drivers/ata/ahci_sunxi.c                  |  2 +-
 drivers/ata/ahci_tegra.c                  |  2 +-
 drivers/ata/ahci_xgene.c                  |  2 +-
 drivers/ata/ata_generic.c                 |  2 +-
 drivers/ata/ata_piix.c                    |  6 +++---
 drivers/ata/libahci.c                     |  4 ++--
 drivers/ata/libahci_platform.c            |  2 +-
 drivers/ata/libata-core.c                 |  4 ++--
 drivers/ata/libata-scsi.c                 |  2 +-
 drivers/ata/libata-sff.c                  |  8 ++++----
 drivers/ata/libata.h                      |  2 +-
 drivers/ata/pata_acpi.c                   |  2 +-
 drivers/ata/pata_ali.c                    |  2 +-
 drivers/ata/pata_amd.c                    |  2 +-
 drivers/ata/pata_arasan_cf.c              |  2 +-
 drivers/ata/pata_artop.c                  |  2 +-
 drivers/ata/pata_atiixp.c                 |  2 +-
 drivers/ata/pata_atp867x.c                |  2 +-
 drivers/ata/pata_buddha.c                 |  2 +-
 drivers/ata/pata_cmd640.c                 |  2 +-
 drivers/ata/pata_cmd64x.c                 |  2 +-
 drivers/ata/pata_cs5520.c                 |  2 +-
 drivers/ata/pata_cs5530.c                 |  2 +-
 drivers/ata/pata_cs5535.c                 |  2 +-
 drivers/ata/pata_cs5536.c                 |  2 +-
 drivers/ata/pata_cypress.c                |  2 +-
 drivers/ata/pata_efar.c                   |  2 +-
 drivers/ata/pata_ep93xx.c                 |  2 +-
 drivers/ata/pata_falcon.c                 |  2 +-
 drivers/ata/pata_ftide010.c               |  2 +-
 drivers/ata/pata_gayle.c                  |  2 +-
 drivers/ata/pata_hpt366.c                 |  2 +-
 drivers/ata/pata_hpt37x.c                 |  2 +-
 drivers/ata/pata_hpt3x2n.c                |  2 +-
 drivers/ata/pata_hpt3x3.c                 |  2 +-
 drivers/ata/pata_icside.c                 |  2 +-
 drivers/ata/pata_imx.c                    |  2 +-
 drivers/ata/pata_isapnp.c                 |  2 +-
 drivers/ata/pata_it8213.c                 |  2 +-
 drivers/ata/pata_it821x.c                 |  2 +-
 drivers/ata/pata_ixp4xx_cf.c              |  2 +-
 drivers/ata/pata_jmicron.c                |  2 +-
 drivers/ata/pata_legacy.c                 |  2 +-
 drivers/ata/pata_macio.c                  |  2 +-
 drivers/ata/pata_marvell.c                |  2 +-
 drivers/ata/pata_mpc52xx.c                |  2 +-
 drivers/ata/pata_mpiix.c                  |  2 +-
 drivers/ata/pata_netcell.c                |  2 +-
 drivers/ata/pata_ninja32.c                |  2 +-
 drivers/ata/pata_ns87410.c                |  2 +-
 drivers/ata/pata_ns87415.c                |  2 +-
 drivers/ata/pata_octeon_cf.c              |  2 +-
 drivers/ata/pata_of_platform.c            |  2 +-
 drivers/ata/pata_oldpiix.c                |  2 +-
 drivers/ata/pata_opti.c                   |  2 +-
 drivers/ata/pata_optidma.c                |  2 +-
 drivers/ata/pata_parport/pata_parport.c   |  2 +-
 drivers/ata/pata_pcmcia.c                 |  2 +-
 drivers/ata/pata_pdc2027x.c               |  2 +-
 drivers/ata/pata_pdc202xx_old.c           |  2 +-
 drivers/ata/pata_piccolo.c                |  2 +-
 drivers/ata/pata_platform.c               |  4 ++--
 drivers/ata/pata_pxa.c                    |  2 +-
 drivers/ata/pata_radisys.c                |  2 +-
 drivers/ata/pata_rb532_cf.c               |  2 +-
 drivers/ata/pata_rdc.c                    |  2 +-
 drivers/ata/pata_rz1000.c                 |  2 +-
 drivers/ata/pata_sc1200.c                 |  2 +-
 drivers/ata/pata_sch.c                    |  2 +-
 drivers/ata/pata_serverworks.c            |  6 +++---
 drivers/ata/pata_sil680.c                 |  2 +-
 drivers/ata/pata_sis.c                    |  2 +-
 drivers/ata/pata_sl82c105.c               |  2 +-
 drivers/ata/pata_triflex.c                |  2 +-
 drivers/ata/pata_via.c                    |  2 +-
 drivers/ata/pdc_adma.c                    |  2 +-
 drivers/ata/sata_dwc_460ex.c              |  2 +-
 drivers/ata/sata_fsl.c                    |  2 +-
 drivers/ata/sata_highbank.c               |  2 +-
 drivers/ata/sata_inic162x.c               |  2 +-
 drivers/ata/sata_mv.c                     |  4 ++--
 drivers/ata/sata_nv.c                     |  8 ++++----
 drivers/ata/sata_promise.c                |  2 +-
 drivers/ata/sata_qstor.c                  |  2 +-
 drivers/ata/sata_rcar.c                   |  2 +-
 drivers/ata/sata_sil.c                    |  2 +-
 drivers/ata/sata_sil24.c                  |  2 +-
 drivers/ata/sata_sis.c                    |  2 +-
 drivers/ata/sata_svw.c                    |  2 +-
 drivers/ata/sata_sx4.c                    |  2 +-
 drivers/ata/sata_uli.c                    |  2 +-
 drivers/ata/sata_via.c                    |  2 +-
 drivers/ata/sata_vsc.c                    |  2 +-
 drivers/firewire/sbp2.c                   |  4 ++--
 drivers/infiniband/ulp/iser/iscsi_iser.c  |  4 ++--
 drivers/infiniband/ulp/srp/ib_srp.c       |  2 +-
 drivers/message/fusion/mptfc.c            |  2 +-
 drivers/message/fusion/mptsas.c           |  2 +-
 drivers/message/fusion/mptspi.c           |  2 +-
 drivers/s390/scsi/zfcp_scsi.c             |  2 +-
 drivers/scsi/3w-9xxx.c                    |  3 +--
 drivers/scsi/3w-sas.c                     |  3 +--
 drivers/scsi/3w-xxxx.c                    |  2 +-
 drivers/scsi/BusLogic.c                   |  4 ++--
 drivers/scsi/a100u2w.c                    |  2 +-
 drivers/scsi/a2091.c                      |  2 +-
 drivers/scsi/a3000.c                      |  2 +-
 drivers/scsi/aacraid/linit.c              |  2 +-
 drivers/scsi/advansys.c                   |  2 +-
 drivers/scsi/aha152x.c                    |  4 ++--
 drivers/scsi/aha1542.c                    |  5 +++--
 drivers/scsi/aha1740.c                    |  2 +-
 drivers/scsi/aic94xx/aic94xx_init.c       |  2 +-
 drivers/scsi/am53c974.c                   |  2 +-
 drivers/scsi/arcmsr/arcmsr_hba.c          |  2 +-
 drivers/scsi/arm/acornscsi.c              |  2 +-
 drivers/scsi/arm/arxescsi.c               |  2 +-
 drivers/scsi/arm/cumana_1.c               |  2 +-
 drivers/scsi/arm/cumana_2.c               |  2 +-
 drivers/scsi/arm/eesox.c                  |  2 +-
 drivers/scsi/arm/oak.c                    |  2 +-
 drivers/scsi/arm/powertec.c               |  2 +-
 drivers/scsi/atp870u.c                    |  4 ++--
 drivers/scsi/be2iscsi/be_main.c           |  2 +-
 drivers/scsi/bnx2i/bnx2i_iscsi.c          |  4 ++--
 drivers/scsi/cxgbi/cxgb3i/cxgb3i.c        |  2 +-
 drivers/scsi/cxgbi/libcxgbi.c             |  2 +-
 drivers/scsi/cxgbi/libcxgbi.h             |  2 +-
 drivers/scsi/dc395x.c                     |  2 +-
 drivers/scsi/dmx3191d.c                   |  2 +-
 drivers/scsi/elx/efct/efct_xport.c        |  2 +-
 drivers/scsi/esas2r/esas2r_main.c         |  2 +-
 drivers/scsi/esp_scsi.c                   |  2 +-
 drivers/scsi/esp_scsi.h                   |  2 +-
 drivers/scsi/fcoe/fcoe.c                  |  2 +-
 drivers/scsi/fdomain.c                    |  2 +-
 drivers/scsi/fnic/fnic_main.c             |  2 +-
 drivers/scsi/g_NCR5380.c                  |  4 ++--
 drivers/scsi/gvp11.c                      |  2 +-
 drivers/scsi/hisi_sas/hisi_sas.h          |  2 +-
 drivers/scsi/hisi_sas/hisi_sas_v1_hw.c    |  2 +-
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c    |  2 +-
 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c    |  2 +-
 drivers/scsi/hosts.c                      |  4 ++--
 drivers/scsi/hpsa.c                       |  2 +-
 drivers/scsi/hptiop.c                     |  2 +-
 drivers/scsi/ibmvscsi/ibmvfc.c            |  2 +-
 drivers/scsi/imm.c                        |  2 +-
 drivers/scsi/initio.c                     |  2 +-
 drivers/scsi/ipr.c                        |  2 +-
 drivers/scsi/isci/init.c                  |  2 +-
 drivers/scsi/iscsi_tcp.c                  |  4 ++--
 drivers/scsi/jazz_esp.c                   |  2 +-
 drivers/scsi/libiscsi.c                   |  2 +-
 drivers/scsi/mac53c94.c                   |  2 +-
 drivers/scsi/mac_esp.c                    |  2 +-
 drivers/scsi/megaraid.c                   |  2 +-
 drivers/scsi/megaraid/megaraid_mbox.c     |  2 +-
 drivers/scsi/megaraid/megaraid_sas_base.c |  2 +-
 drivers/scsi/mesh.c                       |  2 +-
 drivers/scsi/mpi3mr/mpi3mr_os.c           |  2 +-
 drivers/scsi/mpt3sas/mpt3sas_scsih.c      |  4 ++--
 drivers/scsi/mvme147.c                    |  2 +-
 drivers/scsi/mvsas/mv_init.c              |  2 +-
 drivers/scsi/mvumi.c                      |  2 +-
 drivers/scsi/myrb.c                       |  2 +-
 drivers/scsi/myrs.c                       |  2 +-
 drivers/scsi/nsp32.c                      |  2 +-
 drivers/scsi/pcmcia/sym53c500_cs.c        |  4 ++--
 drivers/scsi/pm8001/pm8001_init.c         |  2 +-
 drivers/scsi/pmcraid.c                    |  2 +-
 drivers/scsi/ppa.c                        |  2 +-
 drivers/scsi/ps3rom.c                     |  2 +-
 drivers/scsi/qedf/qedf_main.c             |  2 +-
 drivers/scsi/qedi/qedi_gbl.h              |  2 +-
 drivers/scsi/qedi/qedi_iscsi.c            |  2 +-
 drivers/scsi/qla1280.c                    |  2 +-
 drivers/scsi/qla2xxx/qla_gbl.h            |  2 +-
 drivers/scsi/qla2xxx/qla_mid.c            |  2 +-
 drivers/scsi/qla2xxx/qla_os.c             |  4 ++--
 drivers/scsi/qla2xxx/qla_target.c         |  3 +--
 drivers/scsi/qlogicpti.c                  |  2 +-
 drivers/scsi/scsi_error.c                 | 16 ++++++++--------
 drivers/scsi/scsi_sysfs.c                 |  6 +++---
 drivers/scsi/sgiwd93.c                    |  2 +-
 drivers/scsi/smartpqi/smartpqi_init.c     |  2 +-
 drivers/scsi/snic/snic_main.c             |  2 +-
 drivers/scsi/stex.c                       |  2 +-
 drivers/scsi/sun3x_esp.c                  |  2 +-
 drivers/scsi/sun_esp.c                    |  2 +-
 drivers/scsi/sym53c8xx_2/sym_glue.c       |  4 ++--
 drivers/scsi/virtio_scsi.c                |  2 +-
 drivers/scsi/wd719x.c                     |  2 +-
 drivers/scsi/xen-scsifront.c              |  2 +-
 drivers/scsi/zorro_esp.c                  |  2 +-
 drivers/staging/rts5208/rtsx.c            |  2 +-
 drivers/target/loopback/tcm_loop.c        |  2 +-
 drivers/ufs/core/ufshcd.c                 |  2 +-
 drivers/usb/image/microtek.c              |  2 +-
 drivers/usb/storage/uas.c                 |  2 +-
 drivers/usb/storage/usb.c                 |  2 +-
 drivers/usb/storage/usb.h                 |  2 +-
 include/linux/ahci_platform.h             |  2 +-
 include/linux/ata_platform.h              |  2 +-
 include/linux/libata.h                    | 10 +++++-----
 include/linux/raid_class.h                |  2 +-
 include/scsi/libfc.h                      |  2 +-
 include/scsi/libiscsi.h                   |  2 +-
 include/scsi/scsi_host.h                  |  4 ++--
 225 files changed, 268 insertions(+), 270 deletions(-)

Comments

Martin K. Petersen March 25, 2023, 12:14 a.m. UTC | #1
Bart,

> It helps humans and the compiler if it is made explicit that SCSI host
> templates are not modified. Hence this patch series that constifies
> most SCSI host templates. Please consider this patch series for the
> next merge window.

Applied to 6.4/scsi-staging, thanks!
Martin K. Petersen April 3, 2023, 2:15 a.m. UTC | #2
On Wed, 22 Mar 2023 12:53:55 -0700, Bart Van Assche wrote:

> It helps humans and the compiler if it is made explicit that SCSI host
> templates are not modified. Hence this patch series that constifies most
> SCSI host templates. Please consider this patch series for the next merge
> window.
> 
> Thanks,
> 
> [...]

Applied to 6.4/scsi-queue, thanks!

[01/80] scsi: qla2xxx: Refer directly to the qla2xxx_driver_template
        https://git.kernel.org/mkp/scsi/c/a07be936d923
[02/80] scsi: core: Declare most SCSI host template pointers const
        https://git.kernel.org/mkp/scsi/c/31435de97466
[03/80] scsi: core: Declare SCSI host template pointer members const
        https://git.kernel.org/mkp/scsi/c/e0d3f2c694e5
[04/80] ata: Declare SCSI host templates const
        https://git.kernel.org/mkp/scsi/c/25df73d93323
[05/80] firewire: sbp2: Declare the SCSI host template const
        https://git.kernel.org/mkp/scsi/c/0ca31ecacfe5
[06/80] RDMA/srp: Declare the SCSI host template const
        https://git.kernel.org/mkp/scsi/c/4281af9d9f13
[07/80] scsi: message: fusion: Declare SCSI host template members const
        https://git.kernel.org/mkp/scsi/c/95a24cf170ed
[08/80] scsi: zfcp: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/2887b7a8e07f
[09/80] scsi: 3w-9xxx: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/682895797e56
[10/80] scsi: 3w-sas: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/e5be9953cb02
[11/80] scsi: 3w-xxxx: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/ca1b0e01f6b5
[12/80] scsi: BusLogic: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/83e479e12bfc
[13/80] scsi: a100u2w: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/157fc774cc78
[14/80] scsi: a2091: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/4412df387040
[15/80] scsi: a3000: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/88530b3ea902
[16/80] scsi: aacraid: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/0cd7324b9e9d
[17/80] scsi: advansys: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/8afc6e14a69b
[18/80] scsi: aha152x: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/11e58ceacfab
[19/80] scsi: aha1542: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/77168bd721bc
[20/80] scsi: aic94xx: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/dbb26f2b4200
[21/80] scsi: arcmsr: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/34f5d2dc0038
[22/80] scsi: acornscsi: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/5d94e575a1f1
[23/80] scsi: arxescsi: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/116e5de74270
[24/80] scsi: aha1740: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/4df23b30fa23
[25/80] scsi: cumana: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/202423c58724
[26/80] scsi: eesox: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/13c2e9647198
[27/80] scsi: oak: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/644d8d77eee5
[28/80] scsi: powertec: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/9db801178eb8
[29/80] scsi: atp870u: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/f44e1c639ef0
[30/80] scsi: dc395x: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/16c0a2db0c4a
[31/80] scsi: dmx3191d: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/b816c6bf69a7
[32/80] scsi: elx: efct: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/67791ce19f00
[33/80] scsi: esas2r: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/1f4e77dbcbad
[34/80] scsi: esp_scsi: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/3b465a149146
[35/80] scsi: fcoe: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/d15515f91801
[36/80] scsi: fnic: Declare host template const
        https://git.kernel.org/mkp/scsi/c/bf3614bd7e8a
[37/80] scsi: qedf: Declare host template const
        https://git.kernel.org/mkp/scsi/c/be8532d15342
[38/80] scsi: fdomain: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/8e6a87aa9162
[39/80] scsi: NCR5380: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/bd5e469a7f69
[40/80] scsi: gvp11: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/ccc54750f9b7
[41/80] scsi: hisi_sas: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/e8c0ced993dd
[42/80] scsi: hpsa: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/207761bf1a8d
[43/80] scsi: hptiop: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/9194970becd8
[44/80] scsi: ibmvfc: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/7bced3fc285a
[45/80] scsi: imm: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/09dce26c4a89
[46/80] scsi: initio: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/4ba116af0fd3
[47/80] scsi: ipr: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/4ea4394e7120
[48/80] scsi: isci: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/eb60d17a0e4a
[49/80] scsi: iscsi: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/80602aca4fcc
[50/80] scsi: mac53c94: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/5e328664ed0b
[51/80] scsi: megaraid: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/264e222b004c
[52/80] scsi: mesh: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/0fabb7fbad55
[53/80] scsi: mpi3mr: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/b85f82f3c92a
[54/80] scsi: mpt3sas: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/1785ced8bd4b
[55/80] scsi: mvme147: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/c9ac4e73b373
[56/80] scsi: mvsas: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/f01feece6b64
[57/80] scsi: mvumi: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/8a098ba4d996
[58/80] scsi: myrb: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/8e64d59d1f1c
[59/80] scsi: myrs: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/914fa37a8a54
[60/80] scsi: nsp32: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/36242912e24f
[61/80] scsi: pcmcia-sym53c500: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/54aefe23a6c4
[62/80] scsi: pcmcia-pm8001: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/8fe69e4abdb5
[63/80] scsi: pmcraid: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/4e9e0a51aa31
[64/80] scsi: ppa: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/d23901a8d700
[65/80] scsi: ps3rom: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/4fe61364e7d1
[66/80] scsi: qla1280: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/796e8f808298
[67/80] scsi: qla2xxx: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/421c20b7668e
[68/80] scsi: qlogicpti: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/7c7a1419179a
[69/80] scsi: sgiwd93: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/4517353a048e
[70/80] scsi: smartpqi: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/077126d6b941
[71/80] scsi: snic: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/8fb5b37e070e
[72/80] scsi: stex: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/08d6075192d1
[73/80] scsi: sym53c8xx: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/d2c16f8f1ed2
[74/80] scsi: virtio-scsi: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/273ab251950f
[75/80] scsi: wd719x: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/a5b78e81c712
[76/80] scsi: xen-scsifront: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/65e5447a1014
[77/80] scsi: rts5208: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/f8adf8e99a23
[78/80] scsi: target: tcm-loop: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/8e2ab8cda5aa
[79/80] scsi: ufs: Declare SCSI host template const
        https://git.kernel.org/mkp/scsi/c/f2e2fe3dec7f
[80/80] usb: uas: Declare two host templates and host template pointers const
        https://git.kernel.org/mkp/scsi/c/04d1fa4346cc
Bart Van Assche Jan. 8, 2024, 5:48 p.m. UTC | #3
On 1/4/24 01:52, Peter Wang (王信友) wrote:
> On Wed, 2023-03-22 at 12:55 -0700, Bart Van Assche wrote:
>> Make it explicit that the SCSI host template is not modified.
>>
>> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
>> ---
>>   drivers/ufs/core/ufshcd.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
>> index 8e7dfaadc691..35a3bd95c5e4 100644
>> --- a/drivers/ufs/core/ufshcd.c
>> +++ b/drivers/ufs/core/ufshcd.c
>> @@ -8751,7 +8751,7 @@ static struct ufs_hba_variant_params
>> ufs_hba_vps = {
>>   	.ondemand_data.downdifferential	= 5,
>>   };
>>   
>> -static struct scsi_host_template ufshcd_driver_template = {
>> +static const struct scsi_host_template ufshcd_driver_template = {
>>   	.module			= THIS_MODULE,
>>   	.name			= UFSHCD,
>>   	.proc_name		= UFSHCD,
> 
> Hi Bart,
> 
> This patch change scsi_host_templete to const.
> If mediatek host want to modify deault rpm_autosuspend_delay timer,
> could you have any suggestions?

Hi Peter,

Please add a new rpm_autosuspend_delay member to struct Scsi_Host and add code
in scsi_host_alloc() for copying that member from the host template into struct
Scsi_Host. An example is available in commit b125bb99559e.

Bart.
Peter Wang (王信友) Jan. 9, 2024, 1:04 p.m. UTC | #4
> > Hi Bart,
> > 
> > This patch change scsi_host_templete to const.
> > If mediatek host want to modify deault rpm_autosuspend_delay timer,
> > could you have any suggestions?
> 
> Hi Peter,
> 
> Please add a new rpm_autosuspend_delay member to struct Scsi_Host and
> add code
> in scsi_host_alloc() for copying that member from the host template
> into struct
> Scsi_Host. An example is available in commit b125bb99559e.
> 
> Bart.

Hi Bart,

I add rpm_autosuspend_delay member to struct Scsi_Host and make it more
simple to modify value, please have a review for it.

Thanks.
Peter