linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/80] Constify most SCSI host templates
@ 2023-03-22 19:53 Bart Van Assche
  2023-03-22 19:53 ` [PATCH v3 01/80] scsi: qla2xxx: Refer directly to the qla2xxx_driver_template Bart Van Assche
                   ` (81 more replies)
  0 siblings, 82 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:53 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche

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(-)


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

* [PATCH v3 01/80] scsi: qla2xxx: Refer directly to the qla2xxx_driver_template
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
@ 2023-03-22 19:53 ` Bart Van Assche
  2023-03-22 19:53 ` [PATCH v3 02/80] scsi: core: Declare most SCSI host template pointers const Bart Van Assche
                   ` (80 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:53 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Nilesh Javali,
	GR-QLogic-Storage-Upstream, James E.J. Bottomley

Access the qla2xxx_driver_template data structure directly instead of via
the host pointer. This patch prepares for declaring the 'hostt' pointer
const.

Cc: Nilesh Javali <njavali@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/qla2xxx/qla_target.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index aa0cf5ca6c1c..5258b07687a9 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -6395,8 +6395,7 @@ int qlt_add_target(struct qla_hw_data *ha, struct scsi_qla_host *base_vha)
 		return -ENOMEM;
 	}
 
-	if (!(base_vha->host->hostt->supported_mode & MODE_TARGET))
-		base_vha->host->hostt->supported_mode |= MODE_TARGET;
+	qla2xxx_driver_template.supported_mode |= MODE_TARGET;
 
 	rc = btree_init64(&tgt->lun_qpair_map);
 	if (rc) {

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

* [PATCH v3 02/80] scsi: core: Declare most SCSI host template pointers const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
  2023-03-22 19:53 ` [PATCH v3 01/80] scsi: qla2xxx: Refer directly to the qla2xxx_driver_template Bart Van Assche
@ 2023-03-22 19:53 ` Bart Van Assche
  2023-03-22 19:53 ` [PATCH v3 03/80] scsi: core: Declare SCSI host template pointer members const Bart Van Assche
                   ` (79 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:53 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Benjamin Block, John Garry,
	Ming Lei, Christoph Hellwig, Hannes Reinecke, Mike Christie,
	James E.J. Bottomley

Prepare for constifying most SCSI host template pointers by constifying
the SCSI host template pointer arguments and variables in the SCSI core.

Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/scsi_error.c | 16 ++++++++--------
 drivers/scsi/scsi_sysfs.c |  6 +++---
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 2aa2c2aee6e7..3ec8bfd4090f 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -58,7 +58,7 @@
 #define HOST_RESET_SETTLE_TIME  (10)
 
 static int scsi_eh_try_stu(struct scsi_cmnd *scmd);
-static enum scsi_disposition scsi_try_to_abort_cmd(struct scsi_host_template *,
+static enum scsi_disposition scsi_try_to_abort_cmd(const struct scsi_host_template *,
 						   struct scsi_cmnd *);
 
 void scsi_eh_wakeup(struct Scsi_Host *shost)
@@ -699,7 +699,7 @@ EXPORT_SYMBOL_GPL(scsi_check_sense);
 
 static void scsi_handle_queue_ramp_up(struct scsi_device *sdev)
 {
-	struct scsi_host_template *sht = sdev->host->hostt;
+	const struct scsi_host_template *sht = sdev->host->hostt;
 	struct scsi_device *tmp_sdev;
 
 	if (!sht->track_queue_depth ||
@@ -731,7 +731,7 @@ static void scsi_handle_queue_ramp_up(struct scsi_device *sdev)
 
 static void scsi_handle_queue_full(struct scsi_device *sdev)
 {
-	struct scsi_host_template *sht = sdev->host->hostt;
+	const struct scsi_host_template *sht = sdev->host->hostt;
 	struct scsi_device *tmp_sdev;
 
 	if (!sht->track_queue_depth)
@@ -840,7 +840,7 @@ static enum scsi_disposition scsi_try_host_reset(struct scsi_cmnd *scmd)
 	unsigned long flags;
 	enum scsi_disposition rtn;
 	struct Scsi_Host *host = scmd->device->host;
-	struct scsi_host_template *hostt = host->hostt;
+	const struct scsi_host_template *hostt = host->hostt;
 
 	SCSI_LOG_ERROR_RECOVERY(3,
 		shost_printk(KERN_INFO, host, "Snd Host RST\n"));
@@ -870,7 +870,7 @@ static enum scsi_disposition scsi_try_bus_reset(struct scsi_cmnd *scmd)
 	unsigned long flags;
 	enum scsi_disposition rtn;
 	struct Scsi_Host *host = scmd->device->host;
-	struct scsi_host_template *hostt = host->hostt;
+	const struct scsi_host_template *hostt = host->hostt;
 
 	SCSI_LOG_ERROR_RECOVERY(3, scmd_printk(KERN_INFO, scmd,
 		"%s: Snd Bus RST\n", __func__));
@@ -912,7 +912,7 @@ static enum scsi_disposition scsi_try_target_reset(struct scsi_cmnd *scmd)
 	unsigned long flags;
 	enum scsi_disposition rtn;
 	struct Scsi_Host *host = scmd->device->host;
-	struct scsi_host_template *hostt = host->hostt;
+	const struct scsi_host_template *hostt = host->hostt;
 
 	if (!hostt->eh_target_reset_handler)
 		return FAILED;
@@ -941,7 +941,7 @@ static enum scsi_disposition scsi_try_target_reset(struct scsi_cmnd *scmd)
 static enum scsi_disposition scsi_try_bus_device_reset(struct scsi_cmnd *scmd)
 {
 	enum scsi_disposition rtn;
-	struct scsi_host_template *hostt = scmd->device->host->hostt;
+	const struct scsi_host_template *hostt = scmd->device->host->hostt;
 
 	if (!hostt->eh_device_reset_handler)
 		return FAILED;
@@ -970,7 +970,7 @@ static enum scsi_disposition scsi_try_bus_device_reset(struct scsi_cmnd *scmd)
  *    link down on FibreChannel)
  */
 static enum scsi_disposition
-scsi_try_to_abort_cmd(struct scsi_host_template *hostt, struct scsi_cmnd *scmd)
+scsi_try_to_abort_cmd(const struct scsi_host_template *hostt, struct scsi_cmnd *scmd)
 {
 	if (!hostt->eh_abort_handler)
 		return FAILED;
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index ee28f73af4d4..603e8fcfcb8a 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -296,7 +296,7 @@ store_host_reset(struct device *dev, struct device_attribute *attr,
 		const char *buf, size_t count)
 {
 	struct Scsi_Host *shost = class_to_shost(dev);
-	struct scsi_host_template *sht = shost->hostt;
+	const struct scsi_host_template *sht = shost->hostt;
 	int ret = -EINVAL;
 	int type;
 
@@ -1025,7 +1025,7 @@ sdev_store_queue_depth(struct device *dev, struct device_attribute *attr,
 {
 	int depth, retval;
 	struct scsi_device *sdev = to_scsi_device(dev);
-	struct scsi_host_template *sht = sdev->host->hostt;
+	const struct scsi_host_template *sht = sdev->host->hostt;
 
 	if (!sht->change_queue_depth)
 		return -EINVAL;
@@ -1606,7 +1606,7 @@ void scsi_sysfs_device_initialize(struct scsi_device *sdev)
 {
 	unsigned long flags;
 	struct Scsi_Host *shost = sdev->host;
-	struct scsi_host_template *hostt = shost->hostt;
+	const struct scsi_host_template *hostt = shost->hostt;
 	struct scsi_target  *starget = sdev->sdev_target;
 
 	device_initialize(&sdev->sdev_gendev);

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

* [PATCH v3 03/80] scsi: core: Declare SCSI host template pointer members const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
  2023-03-22 19:53 ` [PATCH v3 01/80] scsi: qla2xxx: Refer directly to the qla2xxx_driver_template Bart Van Assche
  2023-03-22 19:53 ` [PATCH v3 02/80] scsi: core: Declare most SCSI host template pointers const Bart Van Assche
@ 2023-03-22 19:53 ` Bart Van Assche
  2023-03-22 19:53 ` [PATCH v3 04/80] ata: Declare SCSI host templates const Bart Van Assche
                   ` (78 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:53 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Benjamin Block, John Garry,
	Christoph Hellwig, Ming Lei, Hannes Reinecke, Mike Christie,
	Jonathan Corbet, James E.J. Bottomley, Jens Axboe

Declare the SCSI host template pointer members const and also the
remaining SCSI host template pointers in the SCSI core.

Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 Documentation/scsi/scsi_mid_low_api.rst | 2 +-
 drivers/scsi/hosts.c                    | 4 ++--
 include/linux/raid_class.h              | 2 +-
 include/scsi/libfc.h                    | 2 +-
 include/scsi/scsi_host.h                | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Documentation/scsi/scsi_mid_low_api.rst b/Documentation/scsi/scsi_mid_low_api.rst
index a8c5bd15a440..6fa3a6279501 100644
--- a/Documentation/scsi/scsi_mid_low_api.rst
+++ b/Documentation/scsi/scsi_mid_low_api.rst
@@ -436,7 +436,7 @@ Details::
     *
     *      Defined in: drivers/scsi/hosts.c .
     **/
-    struct Scsi_Host * scsi_host_alloc(struct scsi_host_template * sht,
+    struct Scsi_Host * scsi_host_alloc(const struct scsi_host_template * sht,
 				    int privsize)
 
 
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index f7f62e56afca..0ac3289f6b09 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -219,7 +219,7 @@ EXPORT_SYMBOL(scsi_remove_host);
 int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
 			   struct device *dma_dev)
 {
-	struct scsi_host_template *sht = shost->hostt;
+	const struct scsi_host_template *sht = shost->hostt;
 	int error = -EINVAL;
 
 	shost_printk(KERN_INFO, shost, "%s\n",
@@ -392,7 +392,7 @@ static struct device_type scsi_host_type = {
  * Return value:
  * 	Pointer to a new Scsi_Host
  **/
-struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
+struct Scsi_Host *scsi_host_alloc(const struct scsi_host_template *sht, int privsize)
 {
 	struct Scsi_Host *shost;
 	int index;
diff --git a/include/linux/raid_class.h b/include/linux/raid_class.h
index 5cdfcb873a8f..6a9b177d5c41 100644
--- a/include/linux/raid_class.h
+++ b/include/linux/raid_class.h
@@ -11,7 +11,7 @@ struct raid_template {
 };
 
 struct raid_function_template {
-	void *cookie;
+	const void *cookie;
 	int (*is_raid)(struct device *);
 	void (*get_resync)(struct device *);
 	void (*get_state)(struct device *);
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 6e29e1719db1..eca6fd42d7f7 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -866,7 +866,7 @@ static inline void *lport_priv(const struct fc_lport *lport)
  * Returns: libfc lport
  */
 static inline struct fc_lport *
-libfc_host_alloc(struct scsi_host_template *sht, int priv_size)
+libfc_host_alloc(const struct scsi_host_template *sht, int priv_size)
 {
 	struct fc_lport *lport;
 	struct Scsi_Host *shost;
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 587cc767bb67..0f29799efa02 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -554,7 +554,7 @@ struct Scsi_Host {
 	struct completion     * eh_action; /* Wait for specific actions on the
 					      host. */
 	wait_queue_head_t       host_wait;
-	struct scsi_host_template *hostt;
+	const struct scsi_host_template *hostt;
 	struct scsi_transport_template *transportt;
 
 	struct kref		tagset_refcnt;
@@ -747,7 +747,7 @@ static inline int scsi_host_in_recovery(struct Scsi_Host *shost)
 extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *);
 extern void scsi_flush_work(struct Scsi_Host *);
 
-extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *, int);
+extern struct Scsi_Host *scsi_host_alloc(const struct scsi_host_template *, int);
 extern int __must_check scsi_add_host_with_dma(struct Scsi_Host *,
 					       struct device *,
 					       struct device *);

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

* [PATCH v3 04/80] ata: Declare SCSI host templates const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (2 preceding siblings ...)
  2023-03-22 19:53 ` [PATCH v3 03/80] scsi: core: Declare SCSI host template pointer members const Bart Van Assche
@ 2023-03-22 19:53 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 05/80] firewire: sbp2: Declare the SCSI host template const Bart Van Assche
                   ` (77 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:53 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Linus Walleij, Damien Le Moal,
	Serge Semin, John Garry, Jon Hunter, Christoph Hellwig, Ming Lei,
	Hannes Reinecke, Mike Christie, Shawn Guo, Sascha Hauer,
	Matthias Brugger, Hans de Goede, Jens Axboe, Patrice Chotard,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Thierry Reding,
	Viresh Kumar, Mikael Pettersson, Ondrej Zary, Sergey Shtylyov

Make it explicit that ATA host templates are not modified.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com> (for DWC AHCI SATA)
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com> (for Tegra)
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: John Garry <john.g.garry@oracle.com>
Cc: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 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 +-
 include/linux/ahci_platform.h           |  2 +-
 include/linux/ata_platform.h            |  2 +-
 include/linux/libata.h                  | 10 +++++-----
 111 files changed, 129 insertions(+), 129 deletions(-)

diff --git a/drivers/ata/acard-ahci.c b/drivers/ata/acard-ahci.c
index 993eadd173da..547f56341705 100644
--- a/drivers/ata/acard-ahci.c
+++ b/drivers/ata/acard-ahci.c
@@ -66,7 +66,7 @@ static int acard_ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg
 static int acard_ahci_pci_device_resume(struct pci_dev *pdev);
 #endif
 
-static struct scsi_host_template acard_ahci_sht = {
+static const struct scsi_host_template acard_ahci_sht = {
 	AHCI_SHT("acard-ahci"),
 };
 
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 14a1c0d14916..addba109406b 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -101,7 +101,7 @@ static int ahci_pci_device_resume(struct device *dev);
 #endif
 #endif /* CONFIG_PM */
 
-static struct scsi_host_template ahci_sht = {
+static const struct scsi_host_template ahci_sht = {
 	AHCI_SHT("ahci"),
 };
 
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index ff8e6ae1c636..4bae95b06ae3 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -430,7 +430,7 @@ void ahci_set_em_messages(struct ahci_host_priv *hpriv,
 			  struct ata_port_info *pi);
 int ahci_reset_em(struct ata_host *host);
 void ahci_print_info(struct ata_host *host, const char *scc_s);
-int ahci_host_activate(struct ata_host *host, struct scsi_host_template *sht);
+int ahci_host_activate(struct ata_host *host, const struct scsi_host_template *sht);
 void ahci_error_handler(struct ata_port *ap);
 u32 ahci_handle_port_intr(struct ata_host *host, u32 irq_masked);
 
diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index 6f216eb25610..4e3dc2b6d67f 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -417,7 +417,7 @@ static int __maybe_unused brcm_ahci_resume(struct device *dev)
 	return ret;
 }
 
-static struct scsi_host_template ahci_platform_sht = {
+static const struct scsi_host_template ahci_platform_sht = {
 	AHCI_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c
index cb24ecf36faf..bc027468decb 100644
--- a/drivers/ata/ahci_ceva.c
+++ b/drivers/ata/ahci_ceva.c
@@ -185,7 +185,7 @@ static void ahci_ceva_setup(struct ahci_host_priv *hpriv)
 	}
 }
 
-static struct scsi_host_template ahci_platform_sht = {
+static const struct scsi_host_template ahci_platform_sht = {
 	AHCI_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c
index dc8a019b8340..ca0924dc5bd2 100644
--- a/drivers/ata/ahci_da850.c
+++ b/drivers/ata/ahci_da850.c
@@ -153,7 +153,7 @@ static const struct ata_port_info ahci_da850_port_info = {
 	.port_ops	= &ahci_da850_port_ops,
 };
 
-static struct scsi_host_template ahci_platform_sht = {
+static const struct scsi_host_template ahci_platform_sht = {
 	AHCI_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/ahci_dm816.c b/drivers/ata/ahci_dm816.c
index d26efcd20f64..b08547b877a1 100644
--- a/drivers/ata/ahci_dm816.c
+++ b/drivers/ata/ahci_dm816.c
@@ -134,7 +134,7 @@ static const struct ata_port_info ahci_dm816_port_info = {
 	.port_ops	= &ahci_dm816_port_ops,
 };
 
-static struct scsi_host_template ahci_dm816_platform_sht = {
+static const struct scsi_host_template ahci_dm816_platform_sht = {
 	AHCI_SHT(AHCI_DM816_DRV_NAME),
 };
 
diff --git a/drivers/ata/ahci_dwc.c b/drivers/ata/ahci_dwc.c
index 8fb66860db31..4bfbb09cdc02 100644
--- a/drivers/ata/ahci_dwc.c
+++ b/drivers/ata/ahci_dwc.c
@@ -398,7 +398,7 @@ static const struct ata_port_info ahci_dwc_port_info = {
 	.port_ops	= &ahci_dwc_port_ops,
 };
 
-static struct scsi_host_template ahci_dwc_scsi_info = {
+static const struct scsi_host_template ahci_dwc_scsi_info = {
 	AHCI_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c
index a950767f7948..1c1139dae29a 100644
--- a/drivers/ata/ahci_imx.c
+++ b/drivers/ata/ahci_imx.c
@@ -979,7 +979,7 @@ static u32 imx_ahci_parse_props(struct device *dev,
 	return reg_value;
 }
 
-static struct scsi_host_template ahci_platform_sht = {
+static const struct scsi_host_template ahci_platform_sht = {
 	AHCI_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/ahci_mtk.c b/drivers/ata/ahci_mtk.c
index c056378e3e72..f6a75341256f 100644
--- a/drivers/ata/ahci_mtk.c
+++ b/drivers/ata/ahci_mtk.c
@@ -37,7 +37,7 @@ static const struct ata_port_info ahci_port_info = {
 	.port_ops	= &ahci_platform_ops,
 };
 
-static struct scsi_host_template ahci_platform_sht = {
+static const struct scsi_host_template ahci_platform_sht = {
 	AHCI_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c
index 22ecc4f3ae79..596cf017f427 100644
--- a/drivers/ata/ahci_mvebu.c
+++ b/drivers/ata/ahci_mvebu.c
@@ -178,7 +178,7 @@ static const struct ata_port_info ahci_mvebu_port_info = {
 	.port_ops  = &ahci_platform_ops,
 };
 
-static struct scsi_host_template ahci_platform_sht = {
+static const struct scsi_host_template ahci_platform_sht = {
 	AHCI_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index 8f5572a9f8f1..299ee686ac49 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -36,7 +36,7 @@ static const struct ata_port_info ahci_port_info_nolpm = {
 	.port_ops	= &ahci_platform_ops,
 };
 
-static struct scsi_host_template ahci_platform_sht = {
+static const struct scsi_host_template ahci_platform_sht = {
 	AHCI_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c
index 9cf9bf36a874..0ba764d283c8 100644
--- a/drivers/ata/ahci_qoriq.c
+++ b/drivers/ata/ahci_qoriq.c
@@ -159,7 +159,7 @@ static const struct ata_port_info ahci_qoriq_port_info = {
 	.port_ops	= &ahci_qoriq_ops,
 };
 
-static struct scsi_host_template ahci_qoriq_sht = {
+static const struct scsi_host_template ahci_qoriq_sht = {
 	AHCI_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/ahci_seattle.c b/drivers/ata/ahci_seattle.c
index ced12705ed9d..9eda7bbd2151 100644
--- a/drivers/ata/ahci_seattle.c
+++ b/drivers/ata/ahci_seattle.c
@@ -72,7 +72,7 @@ static const struct ata_port_info ahci_port_seattle_info = {
 	.port_ops	= &ahci_seattle_ops,
 };
 
-static struct scsi_host_template ahci_platform_sht = {
+static const struct scsi_host_template ahci_platform_sht = {
 	AHCI_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/ahci_st.c b/drivers/ata/ahci_st.c
index 8607b68eee53..f2c1edb36986 100644
--- a/drivers/ata/ahci_st.c
+++ b/drivers/ata/ahci_st.c
@@ -138,7 +138,7 @@ static const struct ata_port_info st_ahci_port_info = {
 	.port_ops       = &st_ahci_port_ops,
 };
 
-static struct scsi_host_template ahci_platform_sht = {
+static const struct scsi_host_template ahci_platform_sht = {
 	AHCI_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c
index c7273c1cb0c7..076c12b4ba08 100644
--- a/drivers/ata/ahci_sunxi.c
+++ b/drivers/ata/ahci_sunxi.c
@@ -206,7 +206,7 @@ static const struct ata_port_info ahci_sunxi_port_info = {
 	.port_ops	= &ahci_platform_ops,
 };
 
-static struct scsi_host_template ahci_platform_sht = {
+static const struct scsi_host_template ahci_platform_sht = {
 	AHCI_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/ahci_tegra.c b/drivers/ata/ahci_tegra.c
index 4fb94db1217d..8e5e2b359f2d 100644
--- a/drivers/ata/ahci_tegra.c
+++ b/drivers/ata/ahci_tegra.c
@@ -506,7 +506,7 @@ static const struct of_device_id tegra_ahci_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, tegra_ahci_of_match);
 
-static struct scsi_host_template ahci_platform_sht = {
+static const struct scsi_host_template ahci_platform_sht = {
 	AHCI_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index 1e08704d5117..83f5ff54ef5b 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -710,7 +710,7 @@ static int xgene_ahci_mux_select(struct xgene_ahci_context *ctx)
 	return val & CFG_SATA_ENET_SELECT_MASK ? -1 : 0;
 }
 
-static struct scsi_host_template ahci_platform_sht = {
+static const struct scsi_host_template ahci_platform_sht = {
 	AHCI_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/ata_generic.c b/drivers/ata/ata_generic.c
index 20a32e4d501d..2f57ec00ab82 100644
--- a/drivers/ata/ata_generic.c
+++ b/drivers/ata/ata_generic.c
@@ -95,7 +95,7 @@ static int generic_set_mode(struct ata_link *link, struct ata_device **unused)
 	return 0;
 }
 
-static struct scsi_host_template generic_sht = {
+static const struct scsi_host_template generic_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index ade5e894563b..ec3c5bd1f813 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -1059,7 +1059,7 @@ static u8 piix_vmw_bmdma_status(struct ata_port *ap)
 	return ata_bmdma_status(ap) & ~ATA_DMA_ERR;
 }
 
-static struct scsi_host_template piix_sht = {
+static const struct scsi_host_template piix_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
@@ -1095,7 +1095,7 @@ static struct attribute *piix_sidpr_shost_attrs[] = {
 
 ATTRIBUTE_GROUPS(piix_sidpr_shost);
 
-static struct scsi_host_template piix_sidpr_sht = {
+static const struct scsi_host_template piix_sidpr_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 	.shost_groups		= piix_sidpr_shost_groups,
 };
@@ -1645,7 +1645,7 @@ static int piix_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	struct device *dev = &pdev->dev;
 	struct ata_port_info port_info[2];
 	const struct ata_port_info *ppi[] = { &port_info[0], &port_info[1] };
-	struct scsi_host_template *sht = &piix_sht;
+	const struct scsi_host_template *sht = &piix_sht;
 	unsigned long port_flags;
 	struct ata_host *host;
 	struct piix_host_priv *hpriv;
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 8f216de76648..9c2cb6cbea76 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -2692,7 +2692,7 @@ void ahci_set_em_messages(struct ahci_host_priv *hpriv,
 EXPORT_SYMBOL_GPL(ahci_set_em_messages);
 
 static int ahci_host_activate_multi_irqs(struct ata_host *host,
-					 struct scsi_host_template *sht)
+					 const struct scsi_host_template *sht)
 {
 	struct ahci_host_priv *hpriv = host->private_data;
 	int i, rc;
@@ -2736,7 +2736,7 @@ static int ahci_host_activate_multi_irqs(struct ata_host *host,
  *	RETURNS:
  *	0 on success, -errno otherwise.
  */
-int ahci_host_activate(struct ata_host *host, struct scsi_host_template *sht)
+int ahci_host_activate(struct ata_host *host, const struct scsi_host_template *sht)
 {
 	struct ahci_host_priv *hpriv = host->private_data;
 	int irq = hpriv->irq;
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index b9e336bacf17..d6c3a6ffb0b3 100644
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -680,7 +680,7 @@ EXPORT_SYMBOL_GPL(ahci_platform_get_resources);
 int ahci_platform_init_host(struct platform_device *pdev,
 			    struct ahci_host_priv *hpriv,
 			    const struct ata_port_info *pi_template,
-			    struct scsi_host_template *sht)
+			    const struct scsi_host_template *sht)
 {
 	struct device *dev = &pdev->dev;
 	struct ata_port_info pi = *pi_template;
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 14c17c3bda4e..8bf612bdd61a 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5775,7 +5775,7 @@ static void async_port_probe(void *data, async_cookie_t cookie)
  *	RETURNS:
  *	0 on success, -errno otherwise.
  */
-int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
+int ata_host_register(struct ata_host *host, const struct scsi_host_template *sht)
 {
 	int i, rc;
 
@@ -5883,7 +5883,7 @@ EXPORT_SYMBOL_GPL(ata_host_register);
  */
 int ata_host_activate(struct ata_host *host, int irq,
 		      irq_handler_t irq_handler, unsigned long irq_flags,
-		      struct scsi_host_template *sht)
+		      const struct scsi_host_template *sht)
 {
 	int i, rc;
 	char *irq_desc;
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index e093c7a7deeb..7bb12deab70c 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4186,7 +4186,7 @@ void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd)
 	scsi_done(cmd);
 }
 
-int ata_scsi_add_hosts(struct ata_host *host, struct scsi_host_template *sht)
+int ata_scsi_add_hosts(struct ata_host *host, const struct scsi_host_template *sht)
 {
 	int i, rc;
 
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index cd82d3b5ed14..9d28badfe41d 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -2281,7 +2281,7 @@ EXPORT_SYMBOL_GPL(ata_pci_sff_prepare_host);
  */
 int ata_pci_sff_activate_host(struct ata_host *host,
 			      irq_handler_t irq_handler,
-			      struct scsi_host_template *sht)
+			      const struct scsi_host_template *sht)
 {
 	struct device *dev = host->dev;
 	struct pci_dev *pdev = to_pci_dev(dev);
@@ -2378,7 +2378,7 @@ static const struct ata_port_info *ata_sff_find_valid_pi(
 
 static int ata_pci_init_one(struct pci_dev *pdev,
 		const struct ata_port_info * const *ppi,
-		struct scsi_host_template *sht, void *host_priv,
+		const struct scsi_host_template *sht, void *host_priv,
 		int hflags, bool bmdma)
 {
 	struct device *dev = &pdev->dev;
@@ -2452,7 +2452,7 @@ static int ata_pci_init_one(struct pci_dev *pdev,
  */
 int ata_pci_sff_init_one(struct pci_dev *pdev,
 		 const struct ata_port_info * const *ppi,
-		 struct scsi_host_template *sht, void *host_priv, int hflag)
+		 const struct scsi_host_template *sht, void *host_priv, int hflag)
 {
 	return ata_pci_init_one(pdev, ppi, sht, host_priv, hflag, 0);
 }
@@ -3175,7 +3175,7 @@ EXPORT_SYMBOL_GPL(ata_pci_bmdma_prepare_host);
  */
 int ata_pci_bmdma_init_one(struct pci_dev *pdev,
 			   const struct ata_port_info * const * ppi,
-			   struct scsi_host_template *sht, void *host_priv,
+			   const struct scsi_host_template *sht, void *host_priv,
 			   int hflags)
 {
 	return ata_pci_init_one(pdev, ppi, sht, host_priv, hflags, 1);
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h
index 2cd6124a01e8..926d0d33cd29 100644
--- a/drivers/ata/libata.h
+++ b/drivers/ata/libata.h
@@ -111,7 +111,7 @@ static inline void ata_acpi_bind_dev(struct ata_device *dev) {}
 extern struct ata_device *ata_scsi_find_dev(struct ata_port *ap,
 					    const struct scsi_device *scsidev);
 extern int ata_scsi_add_hosts(struct ata_host *host,
-			      struct scsi_host_template *sht);
+			      const struct scsi_host_template *sht);
 extern void ata_scsi_scan_host(struct ata_port *ap, int sync);
 extern int ata_scsi_offline_dev(struct ata_device *dev);
 extern bool ata_scsi_sense_is_valid(u8 sk, u8 asc, u8 ascq);
diff --git a/drivers/ata/pata_acpi.c b/drivers/ata/pata_acpi.c
index f8706ee427d2..ab38871b5e00 100644
--- a/drivers/ata/pata_acpi.c
+++ b/drivers/ata/pata_acpi.c
@@ -205,7 +205,7 @@ static int pacpi_port_start(struct ata_port *ap)
 	return ata_bmdma_port_start(ap);
 }
 
-static struct scsi_host_template pacpi_sht = {
+static const struct scsi_host_template pacpi_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index 76ad0e73fe2a..bb790edd6036 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -355,7 +355,7 @@ static void ali_c2_c3_postreset(struct ata_link *link, unsigned int *classes)
 	ata_sff_postreset(link, classes);
 }
 
-static struct scsi_host_template ali_sht = {
+static const struct scsi_host_template ali_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index f216f9d7b9ec..5b02b89748b7 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -388,7 +388,7 @@ static void nv_host_stop(struct ata_host *host)
 	pci_write_config_dword(to_pci_dev(host->dev), 0x60, udma);
 }
 
-static struct scsi_host_template amd_sht = {
+static const struct scsi_host_template amd_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index e89617ed9175..6ab294322e79 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -218,7 +218,7 @@ struct arasan_cf_dev {
 	struct ata_queued_cmd *qc;
 };
 
-static struct scsi_host_template arasan_cf_sht = {
+static const struct scsi_host_template arasan_cf_sht = {
 	ATA_BASE_SHT(DRIVER_NAME),
 	.dma_boundary = 0xFFFFFFFFUL,
 };
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
index 20a8f31a3f57..40544282f455 100644
--- a/drivers/ata/pata_artop.c
+++ b/drivers/ata/pata_artop.c
@@ -292,7 +292,7 @@ static int artop6210_qc_defer(struct ata_queued_cmd *qc)
 	return 0;
 }
 
-static struct scsi_host_template artop_sht = {
+static const struct scsi_host_template artop_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c
index efdb94cff68b..8c5cc803aab3 100644
--- a/drivers/ata/pata_atiixp.c
+++ b/drivers/ata/pata_atiixp.c
@@ -251,7 +251,7 @@ static void atiixp_bmdma_stop(struct ata_queued_cmd *qc)
 	ata_bmdma_stop(qc);
 }
 
-static struct scsi_host_template atiixp_sht = {
+static const struct scsi_host_template atiixp_sht = {
 	ATA_BASE_SHT(DRV_NAME),
 	.sg_tablesize		= LIBATA_DUMB_MAX_PRD,
 	.dma_boundary		= ATA_DMA_BOUNDARY,
diff --git a/drivers/ata/pata_atp867x.c b/drivers/ata/pata_atp867x.c
index 779d660415c8..aaef5924f636 100644
--- a/drivers/ata/pata_atp867x.c
+++ b/drivers/ata/pata_atp867x.c
@@ -259,7 +259,7 @@ static int atp867x_cable_detect(struct ata_port *ap)
 	return ATA_CBL_PATA_UNK;
 }
 
-static struct scsi_host_template atp867x_sht = {
+static const struct scsi_host_template atp867x_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_buddha.c b/drivers/ata/pata_buddha.c
index 27d4c417fc60..49bc619b83e2 100644
--- a/drivers/ata/pata_buddha.c
+++ b/drivers/ata/pata_buddha.c
@@ -57,7 +57,7 @@ static unsigned int xsurf_bases[2] = {
 	XSURF_BASE1, XSURF_BASE2
 };
 
-static struct scsi_host_template pata_buddha_sht = {
+static const struct scsi_host_template pata_buddha_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_cmd640.c b/drivers/ata/pata_cmd640.c
index 1a3372a72213..45a7217b136e 100644
--- a/drivers/ata/pata_cmd640.c
+++ b/drivers/ata/pata_cmd640.c
@@ -172,7 +172,7 @@ static bool cmd640_sff_irq_check(struct ata_port *ap)
 	return irq_stat & irq_mask;
 }
 
-static struct scsi_host_template cmd640_sht = {
+static const struct scsi_host_template cmd640_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c
index 5baa4a7819c1..fafea2b79145 100644
--- a/drivers/ata/pata_cmd64x.c
+++ b/drivers/ata/pata_cmd64x.c
@@ -319,7 +319,7 @@ static void cmd646r1_bmdma_stop(struct ata_queued_cmd *qc)
 	ata_bmdma_stop(qc);
 }
 
-static struct scsi_host_template cmd64x_sht = {
+static const struct scsi_host_template cmd64x_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c
index f4289a532f87..422d42761a1d 100644
--- a/drivers/ata/pata_cs5520.c
+++ b/drivers/ata/pata_cs5520.c
@@ -94,7 +94,7 @@ static void cs5520_set_piomode(struct ata_port *ap, struct ata_device *adev)
 	cs5520_set_timings(ap, adev, adev->pio_mode);
 }
 
-static struct scsi_host_template cs5520_sht = {
+static const struct scsi_host_template cs5520_sht = {
 	ATA_BASE_SHT(DRV_NAME),
 	.sg_tablesize		= LIBATA_DUMB_MAX_PRD,
 	.dma_boundary		= ATA_DMA_BOUNDARY,
diff --git a/drivers/ata/pata_cs5530.c b/drivers/ata/pata_cs5530.c
index d5b7ac14e78f..1e67b0f8db43 100644
--- a/drivers/ata/pata_cs5530.c
+++ b/drivers/ata/pata_cs5530.c
@@ -146,7 +146,7 @@ static unsigned int cs5530_qc_issue(struct ata_queued_cmd *qc)
 	return ata_bmdma_qc_issue(qc);
 }
 
-static struct scsi_host_template cs5530_sht = {
+static const struct scsi_host_template cs5530_sht = {
 	ATA_BASE_SHT(DRV_NAME),
 	.sg_tablesize	= LIBATA_DUMB_MAX_PRD,
 	.dma_boundary	= ATA_DMA_BOUNDARY,
diff --git a/drivers/ata/pata_cs5535.c b/drivers/ata/pata_cs5535.c
index c2c3238ff84b..d793fc441b46 100644
--- a/drivers/ata/pata_cs5535.c
+++ b/drivers/ata/pata_cs5535.c
@@ -141,7 +141,7 @@ static void cs5535_set_dmamode(struct ata_port *ap, struct ata_device *adev)
 	wrmsr(ATAC_CH0D0_DMA + 2 * adev->devno, reg, 0);
 }
 
-static struct scsi_host_template cs5535_sht = {
+static const struct scsi_host_template cs5535_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c
index ab47aeb5587f..b811efd2cc34 100644
--- a/drivers/ata/pata_cs5536.c
+++ b/drivers/ata/pata_cs5536.c
@@ -217,7 +217,7 @@ static void cs5536_set_dmamode(struct ata_port *ap, struct ata_device *adev)
 	cs5536_write(pdev, ETC, etc);
 }
 
-static struct scsi_host_template cs5536_sht = {
+static const struct scsi_host_template cs5536_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_cypress.c b/drivers/ata/pata_cypress.c
index 3be5d52a777b..ae347b5c2871 100644
--- a/drivers/ata/pata_cypress.c
+++ b/drivers/ata/pata_cypress.c
@@ -115,7 +115,7 @@ static void cy82c693_set_dmamode(struct ata_port *ap, struct ata_device *adev)
 	outb(0x50, 0x23);
 }
 
-static struct scsi_host_template cy82c693_sht = {
+static const struct scsi_host_template cy82c693_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_efar.c b/drivers/ata/pata_efar.c
index 21da59f35b41..2e6eccf2902f 100644
--- a/drivers/ata/pata_efar.c
+++ b/drivers/ata/pata_efar.c
@@ -234,7 +234,7 @@ static void efar_set_dmamode (struct ata_port *ap, struct ata_device *adev)
 	spin_unlock_irqrestore(&efar_lock, flags);
 }
 
-static struct scsi_host_template efar_sht = {
+static const struct scsi_host_template efar_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c
index 47845d920075..c6e043e05d43 100644
--- a/drivers/ata/pata_ep93xx.c
+++ b/drivers/ata/pata_ep93xx.c
@@ -872,7 +872,7 @@ static int ep93xx_pata_port_start(struct ata_port *ap)
 	return 0;
 }
 
-static struct scsi_host_template ep93xx_pata_sht = {
+static const struct scsi_host_template ep93xx_pata_sht = {
 	ATA_BASE_SHT(DRV_NAME),
 	/* ep93xx dma implementation limit */
 	.sg_tablesize		= 32,
diff --git a/drivers/ata/pata_falcon.c b/drivers/ata/pata_falcon.c
index 823c88622e34..996516e64f13 100644
--- a/drivers/ata/pata_falcon.c
+++ b/drivers/ata/pata_falcon.c
@@ -33,7 +33,7 @@
 #define DRV_NAME "pata_falcon"
 #define DRV_VERSION "0.1.0"
 
-static struct scsi_host_template pata_falcon_sht = {
+static const struct scsi_host_template pata_falcon_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_ftide010.c b/drivers/ata/pata_ftide010.c
index 88924b5daa1a..6f6734c09b11 100644
--- a/drivers/ata/pata_ftide010.c
+++ b/drivers/ata/pata_ftide010.c
@@ -84,7 +84,7 @@ struct ftide010 {
 #define FTIDE010_CLK_MOD_DEV0_UDMA_EN	BIT(4)
 #define FTIDE010_CLK_MOD_DEV1_UDMA_EN	BIT(5)
 
-static struct scsi_host_template pata_ftide010_sht = {
+static const struct scsi_host_template pata_ftide010_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_gayle.c b/drivers/ata/pata_gayle.c
index 65bc9f3042ce..e5aa07f92106 100644
--- a/drivers/ata/pata_gayle.c
+++ b/drivers/ata/pata_gayle.c
@@ -35,7 +35,7 @@
 
 #define GAYLE_CONTROL	0x101a
 
-static struct scsi_host_template pata_gayle_sht = {
+static const struct scsi_host_template pata_gayle_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c
index 7e441fb304d3..bdccd1ba1524 100644
--- a/drivers/ata/pata_hpt366.c
+++ b/drivers/ata/pata_hpt366.c
@@ -312,7 +312,7 @@ static int hpt366_prereset(struct ata_link *link, unsigned long deadline)
 	return ata_sff_prereset(link, deadline);
 }
 
-static struct scsi_host_template hpt36x_sht = {
+static const struct scsi_host_template hpt36x_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
index ce3c5eaa7e76..c0329cf01135 100644
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -526,7 +526,7 @@ static void hpt37x_bmdma_stop(struct ata_queued_cmd *qc)
 }
 
 
-static struct scsi_host_template hpt37x_sht = {
+static const struct scsi_host_template hpt37x_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c
index 617c95522f43..5b1ecccf3c83 100644
--- a/drivers/ata/pata_hpt3x2n.c
+++ b/drivers/ata/pata_hpt3x2n.c
@@ -337,7 +337,7 @@ static unsigned int hpt3x2n_qc_issue(struct ata_queued_cmd *qc)
 	return ata_bmdma_qc_issue(qc);
 }
 
-static struct scsi_host_template hpt3x2n_sht = {
+static const struct scsi_host_template hpt3x2n_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_hpt3x3.c b/drivers/ata/pata_hpt3x3.c
index 83974d5eb387..d65c586b5ad0 100644
--- a/drivers/ata/pata_hpt3x3.c
+++ b/drivers/ata/pata_hpt3x3.c
@@ -136,7 +136,7 @@ static int hpt3x3_atapi_dma(struct ata_queued_cmd *qc)
 
 #endif /* CONFIG_PATA_HPT3X3_DMA */
 
-static struct scsi_host_template hpt3x3_sht = {
+static const struct scsi_host_template hpt3x3_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_icside.c b/drivers/ata/pata_icside.c
index 498383cb6e29..9cfb064782c3 100644
--- a/drivers/ata/pata_icside.c
+++ b/drivers/ata/pata_icside.c
@@ -298,7 +298,7 @@ static int icside_dma_init(struct pata_icside_info *info)
 }
 
 
-static struct scsi_host_template pata_icside_sht = {
+static const struct scsi_host_template pata_icside_sht = {
 	ATA_BASE_SHT(DRV_NAME),
 	.sg_tablesize		= SG_MAX_SEGMENTS,
 	.dma_boundary		= IOMD_DMA_BOUNDARY,
diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
index 150939275b1b..4013f28679a9 100644
--- a/drivers/ata/pata_imx.c
+++ b/drivers/ata/pata_imx.c
@@ -97,7 +97,7 @@ static void pata_imx_set_piomode(struct ata_port *ap, struct ata_device *adev)
 	__raw_writel(val, priv->host_regs + PATA_IMX_ATA_CONTROL);
 }
 
-static struct scsi_host_template pata_imx_sht = {
+static const struct scsi_host_template pata_imx_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_isapnp.c b/drivers/ata/pata_isapnp.c
index 43bb224430d3..25a63d043c8e 100644
--- a/drivers/ata/pata_isapnp.c
+++ b/drivers/ata/pata_isapnp.c
@@ -20,7 +20,7 @@
 #define DRV_NAME "pata_isapnp"
 #define DRV_VERSION "0.2.5"
 
-static struct scsi_host_template isapnp_sht = {
+static const struct scsi_host_template isapnp_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_it8213.c b/drivers/ata/pata_it8213.c
index 8a3e8778163c..b7ac56103c8a 100644
--- a/drivers/ata/pata_it8213.c
+++ b/drivers/ata/pata_it8213.c
@@ -228,7 +228,7 @@ static void it8213_set_dmamode (struct ata_port *ap, struct ata_device *adev)
 	pci_write_config_byte(dev, 0x48, udma_enable);
 }
 
-static struct scsi_host_template it8213_sht = {
+static const struct scsi_host_template it8213_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c
index 8a5b4e0079ab..2fe3fb6102ce 100644
--- a/drivers/ata/pata_it821x.c
+++ b/drivers/ata/pata_it821x.c
@@ -800,7 +800,7 @@ static int it821x_rdc_cable(struct ata_port *ap)
 	return ATA_CBL_PATA80;
 }
 
-static struct scsi_host_template it821x_sht = {
+static const struct scsi_host_template it821x_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index e225913a619d..9a2c1b6cd71f 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -173,7 +173,7 @@ static unsigned int ixp4xx_mmio_data_xfer(struct ata_queued_cmd *qc,
 	return words << 1;
 }
 
-static struct scsi_host_template ixp4xx_sht = {
+static const struct scsi_host_template ixp4xx_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_jmicron.c b/drivers/ata/pata_jmicron.c
index d1b3ce8958dd..f51fb8219762 100644
--- a/drivers/ata/pata_jmicron.c
+++ b/drivers/ata/pata_jmicron.c
@@ -107,7 +107,7 @@ static int jmicron_pre_reset(struct ata_link *link, unsigned long deadline)
 
 /* No PIO or DMA methods needed for this device */
 
-static struct scsi_host_template jmicron_sht = {
+static const struct scsi_host_template jmicron_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c
index 03c580625c2c..448a511cbc17 100644
--- a/drivers/ata/pata_legacy.c
+++ b/drivers/ata/pata_legacy.c
@@ -250,7 +250,7 @@ static int legacy_set_mode(struct ata_link *link, struct ata_device **unused)
 	return 0;
 }
 
-static struct scsi_host_template legacy_sht = {
+static const struct scsi_host_template legacy_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_macio.c b/drivers/ata/pata_macio.c
index 9ccaac9e2bc3..c4d86ea049f0 100644
--- a/drivers/ata/pata_macio.c
+++ b/drivers/ata/pata_macio.c
@@ -908,7 +908,7 @@ static int pata_macio_do_resume(struct pata_macio_priv *priv)
 }
 #endif /* CONFIG_PM_SLEEP */
 
-static struct scsi_host_template pata_macio_sht = {
+static const struct scsi_host_template pata_macio_sht = {
 	__ATA_BASE_SHT(DRV_NAME),
 	.sg_tablesize		= MAX_DCMDS,
 	/* We may not need that strict one */
diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c
index 014ccb0f45dc..8119caaad605 100644
--- a/drivers/ata/pata_marvell.c
+++ b/drivers/ata/pata_marvell.c
@@ -92,7 +92,7 @@ static int marvell_cable_detect(struct ata_port *ap)
 
 /* No PIO or DMA methods needed for this device */
 
-static struct scsi_host_template marvell_sht = {
+static const struct scsi_host_template marvell_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
index 3ebd6522a1fd..66c9dea4ea6e 100644
--- a/drivers/ata/pata_mpc52xx.c
+++ b/drivers/ata/pata_mpc52xx.c
@@ -606,7 +606,7 @@ mpc52xx_ata_task_irq(int irq, void *vpriv)
 	return IRQ_HANDLED;
 }
 
-static struct scsi_host_template mpc52xx_ata_sht = {
+static const struct scsi_host_template mpc52xx_ata_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_mpiix.c b/drivers/ata/pata_mpiix.c
index 8fda0e32c1ab..69e4baf27d72 100644
--- a/drivers/ata/pata_mpiix.c
+++ b/drivers/ata/pata_mpiix.c
@@ -136,7 +136,7 @@ static unsigned int mpiix_qc_issue(struct ata_queued_cmd *qc)
 	return ata_sff_qc_issue(qc);
 }
 
-static struct scsi_host_template mpiix_sht = {
+static const struct scsi_host_template mpiix_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_netcell.c b/drivers/ata/pata_netcell.c
index 06929e77c491..c0b2897fcf40 100644
--- a/drivers/ata/pata_netcell.c
+++ b/drivers/ata/pata_netcell.c
@@ -31,7 +31,7 @@ static unsigned int netcell_read_id(struct ata_device *adev,
 	return err_mask;
 }
 
-static struct scsi_host_template netcell_sht = {
+static const struct scsi_host_template netcell_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_ninja32.c b/drivers/ata/pata_ninja32.c
index f9255d6fd194..76a91013d27d 100644
--- a/drivers/ata/pata_ninja32.c
+++ b/drivers/ata/pata_ninja32.c
@@ -77,7 +77,7 @@ static void ninja32_dev_select(struct ata_port *ap, unsigned int device)
 	}
 }
 
-static struct scsi_host_template ninja32_sht = {
+static const struct scsi_host_template ninja32_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_ns87410.c b/drivers/ata/pata_ns87410.c
index ca3ab2736fef..44cc24d21d5f 100644
--- a/drivers/ata/pata_ns87410.c
+++ b/drivers/ata/pata_ns87410.c
@@ -114,7 +114,7 @@ static unsigned int ns87410_qc_issue(struct ata_queued_cmd *qc)
 	return ata_sff_qc_issue(qc);
 }
 
-static struct scsi_host_template ns87410_sht = {
+static const struct scsi_host_template ns87410_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_ns87415.c b/drivers/ata/pata_ns87415.c
index 9dd6bffefb48..d60e1f69d7b0 100644
--- a/drivers/ata/pata_ns87415.c
+++ b/drivers/ata/pata_ns87415.c
@@ -320,7 +320,7 @@ static struct ata_port_operations ns87560_pata_ops = {
 };
 #endif
 
-static struct scsi_host_template ns87415_sht = {
+static const struct scsi_host_template ns87415_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index 4cbcdc5da038..b1ce9f1761af 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -58,7 +58,7 @@ struct octeon_cf_port {
 	u64 dma_base;
 };
 
-static struct scsi_host_template octeon_cf_sht = {
+static const struct scsi_host_template octeon_cf_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
index ac5a633c00a5..178b28eff170 100644
--- a/drivers/ata/pata_of_platform.c
+++ b/drivers/ata/pata_of_platform.c
@@ -15,7 +15,7 @@
 
 #define DRV_NAME "pata_of_platform"
 
-static struct scsi_host_template pata_platform_sht = {
+static const struct scsi_host_template pata_platform_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_oldpiix.c b/drivers/ata/pata_oldpiix.c
index 22a020374410..dca82d92b004 100644
--- a/drivers/ata/pata_oldpiix.c
+++ b/drivers/ata/pata_oldpiix.c
@@ -204,7 +204,7 @@ static unsigned int oldpiix_qc_issue(struct ata_queued_cmd *qc)
 }
 
 
-static struct scsi_host_template oldpiix_sht = {
+static const struct scsi_host_template oldpiix_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_opti.c b/drivers/ata/pata_opti.c
index 01976c4e4033..3d23f57eb128 100644
--- a/drivers/ata/pata_opti.c
+++ b/drivers/ata/pata_opti.c
@@ -148,7 +148,7 @@ static void opti_set_piomode(struct ata_port *ap, struct ata_device *adev)
 	opti_write_reg(ap, 0x85, CNTRL_REG);
 }
 
-static struct scsi_host_template opti_sht = {
+static const struct scsi_host_template opti_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_optidma.c b/drivers/ata/pata_optidma.c
index ad1090b90e52..dfc36b4ec9c6 100644
--- a/drivers/ata/pata_optidma.c
+++ b/drivers/ata/pata_optidma.c
@@ -334,7 +334,7 @@ static int optidma_set_mode(struct ata_link *link, struct ata_device **r_failed)
 	return rc;
 }
 
-static struct scsi_host_template optidma_sht = {
+static const struct scsi_host_template optidma_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_parport/pata_parport.c b/drivers/ata/pata_parport/pata_parport.c
index 294a266a0dda..02a62310845a 100644
--- a/drivers/ata/pata_parport/pata_parport.c
+++ b/drivers/ata/pata_parport/pata_parport.c
@@ -398,7 +398,7 @@ static struct device pata_parport_bus = {
 	.release = pata_parport_bus_release,
 };
 
-static struct scsi_host_template pata_parport_sht = {
+static const struct scsi_host_template pata_parport_sht = {
 	PATA_PARPORT_SHT("pata_parport")
 };
 
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 8eb066abbd9c..5b602206c522 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -132,7 +132,7 @@ static void pcmcia_8bit_drain_fifo(struct ata_queued_cmd *qc)
 
 }
 
-static struct scsi_host_template pcmcia_sht = {
+static const struct scsi_host_template pcmcia_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index 4191aa61c8e4..6820c5597b14 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
@@ -122,7 +122,7 @@ static struct pci_driver pdc2027x_pci_driver = {
 #endif
 };
 
-static struct scsi_host_template pdc2027x_sht = {
+static const struct scsi_host_template pdc2027x_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c
index f894ff2de0a9..a32723e46357 100644
--- a/drivers/ata/pata_pdc202xx_old.c
+++ b/drivers/ata/pata_pdc202xx_old.c
@@ -289,7 +289,7 @@ static int pdc2026x_check_atapi_dma(struct ata_queued_cmd *qc)
 	return 1;
 }
 
-static struct scsi_host_template pdc202xx_sht = {
+static const struct scsi_host_template pdc202xx_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_piccolo.c b/drivers/ata/pata_piccolo.c
index 389b63b13c70..ced906bf56be 100644
--- a/drivers/ata/pata_piccolo.c
+++ b/drivers/ata/pata_piccolo.c
@@ -62,7 +62,7 @@ static void tosh_set_dmamode(struct ata_port *ap, struct ata_device *adev)
 }
 
 
-static struct scsi_host_template tosh_sht = {
+static const struct scsi_host_template tosh_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c
index 21fb059859bd..87479bc893b2 100644
--- a/drivers/ata/pata_platform.c
+++ b/drivers/ata/pata_platform.c
@@ -45,7 +45,7 @@ static int pata_platform_set_mode(struct ata_link *link, struct ata_device **unu
 	return 0;
 }
 
-static struct scsi_host_template pata_platform_sht = {
+static const struct scsi_host_template pata_platform_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
@@ -97,7 +97,7 @@ static void pata_platform_setup_port(struct ata_ioports *ioaddr,
 int __pata_platform_probe(struct device *dev, struct resource *io_res,
 			  struct resource *ctl_res, struct resource *irq_res,
 			  unsigned int ioport_shift, int __pio_mask,
-			  struct scsi_host_template *sht, bool use16bit)
+			  const struct scsi_host_template *sht, bool use16bit)
 {
 	struct ata_host *host;
 	struct ata_port *ap;
diff --git a/drivers/ata/pata_pxa.c b/drivers/ata/pata_pxa.c
index 985f42c4fd70..ea402e02c46e 100644
--- a/drivers/ata/pata_pxa.c
+++ b/drivers/ata/pata_pxa.c
@@ -136,7 +136,7 @@ static int pxa_check_atapi_dma(struct ata_queued_cmd *qc)
 	return -EOPNOTSUPP;
 }
 
-static struct scsi_host_template pxa_ata_sht = {
+static const struct scsi_host_template pxa_ata_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_radisys.c b/drivers/ata/pata_radisys.c
index 3aca8fe3fdb6..84b001097093 100644
--- a/drivers/ata/pata_radisys.c
+++ b/drivers/ata/pata_radisys.c
@@ -183,7 +183,7 @@ static unsigned int radisys_qc_issue(struct ata_queued_cmd *qc)
 }
 
 
-static struct scsi_host_template radisys_sht = {
+static const struct scsi_host_template radisys_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_rb532_cf.c b/drivers/ata/pata_rb532_cf.c
index 2e110aefe59b..3974d294a341 100644
--- a/drivers/ata/pata_rb532_cf.c
+++ b/drivers/ata/pata_rb532_cf.c
@@ -73,7 +73,7 @@ static struct ata_port_operations rb532_pata_port_ops = {
 
 /* ------------------------------------------------------------------------ */
 
-static struct scsi_host_template rb532_pata_sht = {
+static const struct scsi_host_template rb532_pata_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_rdc.c b/drivers/ata/pata_rdc.c
index ecb229c2c1a2..0a9689862f71 100644
--- a/drivers/ata/pata_rdc.c
+++ b/drivers/ata/pata_rdc.c
@@ -288,7 +288,7 @@ static const struct ata_port_info rdc_port_info = {
 	.port_ops	= &rdc_pata_ops,
 };
 
-static struct scsi_host_template rdc_sht = {
+static const struct scsi_host_template rdc_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_rz1000.c b/drivers/ata/pata_rz1000.c
index fb00c3e5fd19..8e2606793091 100644
--- a/drivers/ata/pata_rz1000.c
+++ b/drivers/ata/pata_rz1000.c
@@ -50,7 +50,7 @@ static int rz1000_set_mode(struct ata_link *link, struct ata_device **unused)
 }
 
 
-static struct scsi_host_template rz1000_sht = {
+static const struct scsi_host_template rz1000_sht = {
 	ATA_PIO_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_sc1200.c b/drivers/ata/pata_sc1200.c
index f28daf62a37d..a388dfb97ad8 100644
--- a/drivers/ata/pata_sc1200.c
+++ b/drivers/ata/pata_sc1200.c
@@ -192,7 +192,7 @@ static int sc1200_qc_defer(struct ata_queued_cmd *qc)
 	return 0;
 }
 
-static struct scsi_host_template sc1200_sht = {
+static const struct scsi_host_template sc1200_sht = {
 	ATA_BASE_SHT(DRV_NAME),
 	.sg_tablesize	= LIBATA_DUMB_MAX_PRD,
 	.dma_boundary	= ATA_DMA_BOUNDARY,
diff --git a/drivers/ata/pata_sch.c b/drivers/ata/pata_sch.c
index 4f9c2aefd807..8356f1f2a025 100644
--- a/drivers/ata/pata_sch.c
+++ b/drivers/ata/pata_sch.c
@@ -57,7 +57,7 @@ static struct pci_driver sch_pci_driver = {
 #endif
 };
 
-static struct scsi_host_template sch_sht = {
+static const struct scsi_host_template sch_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
index c0bc4af0d196..549ff24a9823 100644
--- a/drivers/ata/pata_serverworks.c
+++ b/drivers/ata/pata_serverworks.c
@@ -252,13 +252,13 @@ static void serverworks_set_dmamode(struct ata_port *ap, struct ata_device *adev
 	pci_write_config_byte(pdev, 0x54, ultra_cfg);
 }
 
-static struct scsi_host_template serverworks_osb4_sht = {
+static const struct scsi_host_template serverworks_osb4_sht = {
 	ATA_BASE_SHT(DRV_NAME),
 	.sg_tablesize	= LIBATA_DUMB_MAX_PRD,
 	.dma_boundary	= ATA_DMA_BOUNDARY,
 };
 
-static struct scsi_host_template serverworks_csb_sht = {
+static const struct scsi_host_template serverworks_csb_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
@@ -413,7 +413,7 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id
 		}
 	};
 	const struct ata_port_info *ppi[] = { &info[id->driver_data], NULL };
-	struct scsi_host_template *sht = &serverworks_csb_sht;
+	const struct scsi_host_template *sht = &serverworks_csb_sht;
 	int rc;
 
 	rc = pcim_enable_device(pdev);
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
index 67ef2e26d7df..abe64b5f83cf 100644
--- a/drivers/ata/pata_sil680.c
+++ b/drivers/ata/pata_sil680.c
@@ -223,7 +223,7 @@ static bool sil680_sff_irq_check(struct ata_port *ap)
 	return val & 0x08;
 }
 
-static struct scsi_host_template sil680_sht = {
+static const struct scsi_host_template sil680_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c
index 92e4cf05de2c..31de06b66221 100644
--- a/drivers/ata/pata_sis.c
+++ b/drivers/ata/pata_sis.c
@@ -539,7 +539,7 @@ static unsigned int sis_133_mode_filter(struct ata_device *adev, unsigned int ma
 	return mask;
 }
 
-static struct scsi_host_template sis_sht = {
+static const struct scsi_host_template sis_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_sl82c105.c b/drivers/ata/pata_sl82c105.c
index 8487470e2e01..3b62ea482f1a 100644
--- a/drivers/ata/pata_sl82c105.c
+++ b/drivers/ata/pata_sl82c105.c
@@ -238,7 +238,7 @@ static bool sl82c105_sff_irq_check(struct ata_port *ap)
 	return val & mask;
 }
 
-static struct scsi_host_template sl82c105_sht = {
+static const struct scsi_host_template sl82c105_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_triflex.c b/drivers/ata/pata_triflex.c
index 782162d2f3f8..26d448a869e2 100644
--- a/drivers/ata/pata_triflex.c
+++ b/drivers/ata/pata_triflex.c
@@ -160,7 +160,7 @@ static void triflex_bmdma_stop(struct ata_queued_cmd *qc)
 	triflex_load_timing(qc->ap, qc->dev, qc->dev->pio_mode);
 }
 
-static struct scsi_host_template triflex_sht = {
+static const struct scsi_host_template triflex_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c
index 34f00f389932..696b99720dcb 100644
--- a/drivers/ata/pata_via.c
+++ b/drivers/ata/pata_via.c
@@ -443,7 +443,7 @@ static int via_port_start(struct ata_port *ap)
 	return 0;
 }
 
-static struct scsi_host_template via_sht = {
+static const struct scsi_host_template via_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/pdc_adma.c b/drivers/ata/pdc_adma.c
index 35b823ac20c9..8e6b2599f0d5 100644
--- a/drivers/ata/pdc_adma.c
+++ b/drivers/ata/pdc_adma.c
@@ -123,7 +123,7 @@ static void adma_freeze(struct ata_port *ap);
 static void adma_thaw(struct ata_port *ap);
 static int adma_prereset(struct ata_link *link, unsigned long deadline);
 
-static struct scsi_host_template adma_ata_sht = {
+static const struct scsi_host_template adma_ata_sht = {
 	ATA_BASE_SHT(DRV_NAME),
 	.sg_tablesize		= LIBATA_MAX_PRD,
 	.dma_boundary		= ADMA_DMA_BOUNDARY,
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
index 21d77633a98f..24334a8a3f0b 100644
--- a/drivers/ata/sata_dwc_460ex.c
+++ b/drivers/ata/sata_dwc_460ex.c
@@ -1076,7 +1076,7 @@ static void sata_dwc_dev_select(struct ata_port *ap, unsigned int device)
 /*
  * scsi mid-layer and libata interface structures
  */
-static struct scsi_host_template sata_dwc_sht = {
+static const struct scsi_host_template sata_dwc_sht = {
 	ATA_NCQ_SHT(DRV_NAME),
 	/*
 	 * test-only: Currently this driver doesn't handle NCQ
diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c
index b052c5a65c17..ccd99b9aa9ff 100644
--- a/drivers/ata/sata_fsl.c
+++ b/drivers/ata/sata_fsl.c
@@ -1376,7 +1376,7 @@ static void sata_fsl_host_stop(struct ata_host *host)
 /*
  * scsi mid-layer and libata interface structures
  */
-static struct scsi_host_template sata_fsl_sht = {
+static const struct scsi_host_template sata_fsl_sht = {
 	ATA_NCQ_SHT_QD("sata_fsl", SATA_FSL_QUEUE_DEPTH),
 	.sg_tablesize = SATA_FSL_MAX_PRD_USABLE,
 	.dma_boundary = ATA_DMA_BOUNDARY,
diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
index dfbf9493e451..8237ece4a46f 100644
--- a/drivers/ata/sata_highbank.c
+++ b/drivers/ata/sata_highbank.c
@@ -438,7 +438,7 @@ static const struct ata_port_info ahci_highbank_port_info = {
 	.port_ops       = &ahci_highbank_ops,
 };
 
-static struct scsi_host_template ahci_highbank_platform_sht = {
+static const struct scsi_host_template ahci_highbank_platform_sht = {
 	AHCI_SHT("sata_highbank"),
 };
 
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c
index 2833c722118d..2c8c78ed86c1 100644
--- a/drivers/ata/sata_inic162x.c
+++ b/drivers/ata/sata_inic162x.c
@@ -242,7 +242,7 @@ struct inic_port_priv {
 	dma_addr_t	cpb_tbl_dma;
 };
 
-static struct scsi_host_template inic_sht = {
+static const struct scsi_host_template inic_sht = {
 	ATA_BASE_SHT(DRV_NAME),
 	.sg_tablesize		= LIBATA_MAX_PRD, /* maybe it can be larger? */
 
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index e3cff01201b8..d404e631d152 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -659,13 +659,13 @@ static u8 mv_sff_check_status(struct ata_port *ap);
  * PRDs for 64K boundaries in mv_fill_sg().
  */
 #ifdef CONFIG_PCI
-static struct scsi_host_template mv5_sht = {
+static const struct scsi_host_template mv5_sht = {
 	ATA_BASE_SHT(DRV_NAME),
 	.sg_tablesize		= MV_MAX_SG_CT / 2,
 	.dma_boundary		= MV_DMA_BOUNDARY,
 };
 #endif
-static struct scsi_host_template mv6_sht = {
+static const struct scsi_host_template mv6_sht = {
 	__ATA_BASE_SHT(DRV_NAME),
 	.can_queue		= MV_MAX_Q_DEPTH - 1,
 	.sg_tablesize		= MV_MAX_SG_CT / 2,
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 9b2d289e89e1..abf5651c87ab 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -371,11 +371,11 @@ static struct pci_driver nv_pci_driver = {
 	.remove			= ata_pci_remove_one,
 };
 
-static struct scsi_host_template nv_sht = {
+static const struct scsi_host_template nv_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
-static struct scsi_host_template nv_adma_sht = {
+static const struct scsi_host_template nv_adma_sht = {
 	__ATA_BASE_SHT(DRV_NAME),
 	.can_queue		= NV_ADMA_MAX_CPBS,
 	.sg_tablesize		= NV_ADMA_SGTBL_TOTAL_LEN,
@@ -386,7 +386,7 @@ static struct scsi_host_template nv_adma_sht = {
 	.tag_alloc_policy	= BLK_TAG_ALLOC_RR,
 };
 
-static struct scsi_host_template nv_swncq_sht = {
+static const struct scsi_host_template nv_swncq_sht = {
 	__ATA_BASE_SHT(DRV_NAME),
 	.can_queue		= ATA_MAX_QUEUE - 1,
 	.sg_tablesize		= LIBATA_MAX_PRD,
@@ -520,7 +520,7 @@ static struct ata_port_operations nv_swncq_ops = {
 
 struct nv_pi_priv {
 	irq_handler_t			irq_handler;
-	struct scsi_host_template	*sht;
+	const struct scsi_host_template	*sht;
 };
 
 #define NV_PI_PRIV(_irq_handler, _sht) \
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c
index 4e60e6c4c35a..2df1a070b25a 100644
--- a/drivers/ata/sata_promise.c
+++ b/drivers/ata/sata_promise.c
@@ -158,7 +158,7 @@ static void pdc_error_handler(struct ata_port *ap);
 static void pdc_post_internal_cmd(struct ata_queued_cmd *qc);
 static int pdc_pata_cable_detect(struct ata_port *ap);
 
-static struct scsi_host_template pdc_ata_sht = {
+static const struct scsi_host_template pdc_ata_sht = {
 	ATA_BASE_SHT(DRV_NAME),
 	.sg_tablesize		= PDC_MAX_PRD,
 	.dma_boundary		= ATA_DMA_BOUNDARY,
diff --git a/drivers/ata/sata_qstor.c b/drivers/ata/sata_qstor.c
index 8ca0810aad26..8a6286159044 100644
--- a/drivers/ata/sata_qstor.c
+++ b/drivers/ata/sata_qstor.c
@@ -108,7 +108,7 @@ static void qs_thaw(struct ata_port *ap);
 static int qs_prereset(struct ata_link *link, unsigned long deadline);
 static void qs_error_handler(struct ata_port *ap);
 
-static struct scsi_host_template qs_ata_sht = {
+static const struct scsi_host_template qs_ata_sht = {
 	ATA_BASE_SHT(DRV_NAME),
 	.sg_tablesize		= QS_MAX_PRD,
 	.dma_boundary		= QS_DMA_BOUNDARY,
diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 0195eb29f6c2..34790f15c1b8 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -608,7 +608,7 @@ static u8 sata_rcar_bmdma_status(struct ata_port *ap)
 	return host_stat;
 }
 
-static struct scsi_host_template sata_rcar_sht = {
+static const struct scsi_host_template sata_rcar_sht = {
 	ATA_BASE_SHT(DRV_NAME),
 	/*
 	 * This controller allows transfer chunks up to 512MB which cross 64KB
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c
index 3b989a52879d..cc77c0248284 100644
--- a/drivers/ata/sata_sil.c
+++ b/drivers/ata/sata_sil.c
@@ -156,7 +156,7 @@ static struct pci_driver sil_pci_driver = {
 #endif
 };
 
-static struct scsi_host_template sil_sht = {
+static const struct scsi_host_template sil_sht = {
 	ATA_BASE_SHT(DRV_NAME),
 	/** These controllers support Large Block Transfer which allows
 	    transfer chunks up to 2GB and which cross 64KB boundaries,
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 22cc9e9789dd..e72a0257990d 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -373,7 +373,7 @@ static struct pci_driver sil24_pci_driver = {
 #endif
 };
 
-static struct scsi_host_template sil24_sht = {
+static const struct scsi_host_template sil24_sht = {
 	__ATA_BASE_SHT(DRV_NAME),
 	.can_queue		= SIL24_MAX_CMDS,
 	.sg_tablesize		= SIL24_MAX_SGE,
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c
index 316237362aa9..ef8724986de3 100644
--- a/drivers/ata/sata_sis.c
+++ b/drivers/ata/sata_sis.c
@@ -72,7 +72,7 @@ static struct pci_driver sis_pci_driver = {
 #endif
 };
 
-static struct scsi_host_template sis_sht = {
+static const struct scsi_host_template sis_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
index 2e3418a82b44..c47c3fb434d5 100644
--- a/drivers/ata/sata_svw.c
+++ b/drivers/ata/sata_svw.c
@@ -330,7 +330,7 @@ static int k2_sata_show_info(struct seq_file *m, struct Scsi_Host *shost)
 	return 0;
 }
 
-static struct scsi_host_template k2_sata_sht = {
+static const struct scsi_host_template k2_sata_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 	.show_info		= k2_sata_show_info,
 };
diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c
index a92c60455b1d..ccc016072637 100644
--- a/drivers/ata/sata_sx4.c
+++ b/drivers/ata/sata_sx4.c
@@ -226,7 +226,7 @@ static void pdc_post_internal_cmd(struct ata_queued_cmd *qc);
 static int pdc_check_atapi_dma(struct ata_queued_cmd *qc);
 
 
-static struct scsi_host_template pdc_sata_sht = {
+static const struct scsi_host_template pdc_sata_sht = {
 	ATA_BASE_SHT(DRV_NAME),
 	.sg_tablesize		= LIBATA_MAX_PRD,
 	.dma_boundary		= ATA_DMA_BOUNDARY,
diff --git a/drivers/ata/sata_uli.c b/drivers/ata/sata_uli.c
index 815e6af75310..60ea45926cd1 100644
--- a/drivers/ata/sata_uli.c
+++ b/drivers/ata/sata_uli.c
@@ -59,7 +59,7 @@ static struct pci_driver uli_pci_driver = {
 	.remove			= ata_pci_remove_one,
 };
 
-static struct scsi_host_template uli_sht = {
+static const struct scsi_host_template uli_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c
index c7891cc84ea0..57cbf2cef618 100644
--- a/drivers/ata/sata_via.c
+++ b/drivers/ata/sata_via.c
@@ -107,7 +107,7 @@ static struct pci_driver svia_pci_driver = {
 	.remove			= ata_pci_remove_one,
 };
 
-static struct scsi_host_template svia_sht = {
+static const struct scsi_host_template svia_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/drivers/ata/sata_vsc.c b/drivers/ata/sata_vsc.c
index 87e4ed66b306..d39b87537168 100644
--- a/drivers/ata/sata_vsc.c
+++ b/drivers/ata/sata_vsc.c
@@ -277,7 +277,7 @@ static irqreturn_t vsc_sata_interrupt(int irq, void *dev_instance)
 }
 
 
-static struct scsi_host_template vsc_sata_sht = {
+static const struct scsi_host_template vsc_sata_sht = {
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
diff --git a/include/linux/ahci_platform.h b/include/linux/ahci_platform.h
index 17fa26215292..fe0760ce34c8 100644
--- a/include/linux/ahci_platform.h
+++ b/include/linux/ahci_platform.h
@@ -37,7 +37,7 @@ struct ahci_host_priv *ahci_platform_get_resources(
 int ahci_platform_init_host(struct platform_device *pdev,
 			    struct ahci_host_priv *hpriv,
 			    const struct ata_port_info *pi_template,
-			    struct scsi_host_template *sht);
+			    const struct scsi_host_template *sht);
 
 void ahci_platform_shutdown(struct platform_device *pdev);
 
diff --git a/include/linux/ata_platform.h b/include/linux/ata_platform.h
index 9cafec92282d..b9745cc08e38 100644
--- a/include/linux/ata_platform.h
+++ b/include/linux/ata_platform.h
@@ -19,7 +19,7 @@ extern int __pata_platform_probe(struct device *dev,
 				 struct resource *irq_res,
 				 unsigned int ioport_shift,
 				 int __pio_mask,
-				 struct scsi_host_template *sht,
+				 const struct scsi_host_template *sht,
 				 bool use16bit);
 
 /*
diff --git a/include/linux/libata.h b/include/linux/libata.h
index a759dfbdcc91..311cd93377c7 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1065,10 +1065,10 @@ extern void ata_host_get(struct ata_host *host);
 extern void ata_host_put(struct ata_host *host);
 extern int ata_host_start(struct ata_host *host);
 extern int ata_host_register(struct ata_host *host,
-			     struct scsi_host_template *sht);
+			     const struct scsi_host_template *sht);
 extern int ata_host_activate(struct ata_host *host, int irq,
 			     irq_handler_t irq_handler, unsigned long irq_flags,
-			     struct scsi_host_template *sht);
+			     const struct scsi_host_template *sht);
 extern void ata_host_detach(struct ata_host *host);
 extern void ata_host_init(struct ata_host *, struct device *, struct ata_port_operations *);
 extern int ata_scsi_detect(struct scsi_host_template *sht);
@@ -1980,10 +1980,10 @@ extern int ata_pci_sff_prepare_host(struct pci_dev *pdev,
 				    struct ata_host **r_host);
 extern int ata_pci_sff_activate_host(struct ata_host *host,
 				     irq_handler_t irq_handler,
-				     struct scsi_host_template *sht);
+				     const struct scsi_host_template *sht);
 extern int ata_pci_sff_init_one(struct pci_dev *pdev,
 		const struct ata_port_info * const * ppi,
-		struct scsi_host_template *sht, void *host_priv, int hflags);
+		const struct scsi_host_template *sht, void *host_priv, int hflags);
 #endif /* CONFIG_PCI */
 
 #ifdef CONFIG_ATA_BMDMA
@@ -2019,7 +2019,7 @@ extern int ata_pci_bmdma_prepare_host(struct pci_dev *pdev,
 				      struct ata_host **r_host);
 extern int ata_pci_bmdma_init_one(struct pci_dev *pdev,
 				  const struct ata_port_info * const * ppi,
-				  struct scsi_host_template *sht,
+				  const struct scsi_host_template *sht,
 				  void *host_priv, int hflags);
 #endif /* CONFIG_PCI */
 #endif /* CONFIG_ATA_BMDMA */

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

* [PATCH v3 05/80] firewire: sbp2: Declare the SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (3 preceding siblings ...)
  2023-03-22 19:53 ` [PATCH v3 04/80] ata: Declare SCSI host templates const Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 06/80] RDMA/srp: " Bart Van Assche
                   ` (76 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, Stefan Richter

Make it explicit that the sbp2 host template it not modified.

Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/firewire/sbp2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c
index 60051c0cabea..26db5b8dfc1e 100644
--- a/drivers/firewire/sbp2.c
+++ b/drivers/firewire/sbp2.c
@@ -1117,7 +1117,7 @@ static void sbp2_init_workarounds(struct sbp2_target *tgt, u32 model,
 	tgt->workarounds = w;
 }
 
-static struct scsi_host_template scsi_driver_template;
+static const struct scsi_host_template scsi_driver_template;
 static void sbp2_remove(struct fw_unit *unit);
 
 static int sbp2_probe(struct fw_unit *unit, const struct ieee1394_device_id *id)
@@ -1586,7 +1586,7 @@ static struct attribute *sbp2_scsi_sysfs_attrs[] = {
 
 ATTRIBUTE_GROUPS(sbp2_scsi_sysfs);
 
-static struct scsi_host_template scsi_driver_template = {
+static const struct scsi_host_template scsi_driver_template = {
 	.module			= THIS_MODULE,
 	.name			= "SBP-2 IEEE-1394",
 	.proc_name		= "sbp2",

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

* [PATCH v3 06/80] RDMA/srp: Declare the SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (4 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 05/80] firewire: sbp2: Declare the SCSI host template const Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 07/80] scsi: message: fusion: Declare SCSI host template members const Bart Van Assche
                   ` (75 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Leon Romanovsky, Jason Gunthorpe,
	Leon Romanovsky

Make it explicit that the SRP host template is not modified.

Acked-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/infiniband/ulp/srp/ib_srp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index df21b30b7735..3446fbf5a560 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -3077,7 +3077,7 @@ static struct attribute *srp_host_attrs[] = {
 
 ATTRIBUTE_GROUPS(srp_host);
 
-static struct scsi_host_template srp_template = {
+static const struct scsi_host_template srp_template = {
 	.module				= THIS_MODULE,
 	.name				= "InfiniBand SRP initiator",
 	.proc_name			= DRV_NAME,

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

* [PATCH v3 07/80] scsi: message: fusion: Declare SCSI host template members const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (5 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 06/80] RDMA/srp: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 08/80] scsi: zfcp: Declare SCSI host template const Bart Van Assche
                   ` (74 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Sathya Prakash, Sreekanth Reddy,
	Suganath Prabu Subramani

Make it explicit that the SCSI host templates are not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/message/fusion/mptfc.c  | 2 +-
 drivers/message/fusion/mptsas.c | 2 +-
 drivers/message/fusion/mptspi.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index fac747109209..22e7779a332b 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -105,7 +105,7 @@ static int mptfc_abort(struct scsi_cmnd *SCpnt);
 static int mptfc_dev_reset(struct scsi_cmnd *SCpnt);
 static int mptfc_bus_reset(struct scsi_cmnd *SCpnt);
 
-static struct scsi_host_template mptfc_driver_template = {
+static const struct scsi_host_template mptfc_driver_template = {
 	.module				= THIS_MODULE,
 	.proc_name			= "mptfc",
 	.show_info			= mptscsih_show_info,
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 88fe4a860ae5..86f16f3ea478 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -1997,7 +1997,7 @@ static enum scsi_timeout_action mptsas_eh_timed_out(struct scsi_cmnd *sc)
 }
 
 
-static struct scsi_host_template mptsas_driver_template = {
+static const struct scsi_host_template mptsas_driver_template = {
 	.module				= THIS_MODULE,
 	.proc_name			= "mptsas",
 	.show_info			= mptscsih_show_info,
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index 62089a8caa2f..6c5920db1e9d 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -820,7 +820,7 @@ static void mptspi_slave_destroy(struct scsi_device *sdev)
 	mptscsih_slave_destroy(sdev);
 }
 
-static struct scsi_host_template mptspi_driver_template = {
+static const struct scsi_host_template mptspi_driver_template = {
 	.module				= THIS_MODULE,
 	.proc_name			= "mptspi",
 	.show_info			= mptscsih_show_info,

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

* [PATCH v3 08/80] scsi: zfcp: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (6 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 07/80] scsi: message: fusion: Declare SCSI host template members const Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 09/80] scsi: 3w-9xxx: " Bart Van Assche
                   ` (73 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Benjamin Block, Steffen Maier,
	Heiko Carstens, Vasily Gorbik, Alexander Gordeev

Make it explicit that the SCSI host template is not modified.

Acked-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/s390/scsi/zfcp_scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 3dbf4b21d127..b2a8cd792266 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -418,7 +418,7 @@ static int zfcp_scsi_sysfs_host_reset(struct Scsi_Host *shost, int reset_type)
 
 struct scsi_transport_template *zfcp_scsi_transport_template;
 
-static struct scsi_host_template zfcp_scsi_host_template = {
+static const struct scsi_host_template zfcp_scsi_host_template = {
 	.module			 = THIS_MODULE,
 	.name			 = "zfcp",
 	.queuecommand		 = zfcp_scsi_queuecommand,

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

* [PATCH v3 09/80] scsi: 3w-9xxx: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (7 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 08/80] scsi: zfcp: Declare SCSI host template const Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 10/80] scsi: 3w-sas: " Bart Van Assche
                   ` (72 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Adam Radford, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/3w-9xxx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index 6cb9cca9565b..38d20a69ee12 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -1976,8 +1976,7 @@ static int twa_slave_configure(struct scsi_device *sdev)
 	return 0;
 } /* End twa_slave_configure() */
 
-/* scsi_host_template initializer */
-static struct scsi_host_template driver_template = {
+static const struct scsi_host_template driver_template = {
 	.module			= THIS_MODULE,
 	.name			= "3ware 9000 Storage Controller",
 	.queuecommand		= twa_scsi_queue,

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

* [PATCH v3 10/80] scsi: 3w-sas: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (8 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 09/80] scsi: 3w-9xxx: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 11/80] scsi: 3w-xxxx: " Bart Van Assche
                   ` (71 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Adam Radford, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/3w-sas.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c
index f41c93454f0c..55989eaa2d9f 100644
--- a/drivers/scsi/3w-sas.c
+++ b/drivers/scsi/3w-sas.c
@@ -1530,8 +1530,7 @@ static int twl_slave_configure(struct scsi_device *sdev)
 	return 0;
 } /* End twl_slave_configure() */
 
-/* scsi_host_template initializer */
-static struct scsi_host_template driver_template = {
+static const struct scsi_host_template driver_template = {
 	.module			= THIS_MODULE,
 	.name			= "3w-sas",
 	.queuecommand		= twl_scsi_queue,

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

* [PATCH v3 11/80] scsi: 3w-xxxx: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (9 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 10/80] scsi: 3w-sas: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 12/80] scsi: BusLogic: " Bart Van Assche
                   ` (70 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Adam Radford, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/3w-xxxx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c
index ffdecb12d654..36c34ced0cc1 100644
--- a/drivers/scsi/3w-xxxx.c
+++ b/drivers/scsi/3w-xxxx.c
@@ -2229,7 +2229,7 @@ static int tw_slave_configure(struct scsi_device *sdev)
 	return 0;
 } /* End tw_slave_configure() */
 
-static struct scsi_host_template driver_template = {
+static const struct scsi_host_template driver_template = {
 	.module			= THIS_MODULE,
 	.name			= "3ware Storage Controller",
 	.queuecommand		= tw_scsi_queue,

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

* [PATCH v3 12/80] scsi: BusLogic: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (10 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 11/80] scsi: 3w-xxxx: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 13/80] scsi: a100u2w: " Bart Van Assche
                   ` (69 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Khalid Aziz, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Acked-by: Khalid Aziz <khalid@gonehiking.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/BusLogic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index f7b7ffda1161..72ceaf650b0d 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -54,7 +54,7 @@
 #define FAILURE (-1)
 #endif
 
-static struct scsi_host_template blogic_template;
+static const struct scsi_host_template blogic_template;
 
 /*
   blogic_drvr_options_count is a count of the number of BusLogic Driver
@@ -3663,7 +3663,7 @@ static int __init blogic_parseopts(char *options)
   Get it all started
 */
 
-static struct scsi_host_template blogic_template = {
+static const struct scsi_host_template blogic_template = {
 	.module = THIS_MODULE,
 	.proc_name = "BusLogic",
 	.write_info = blogic_write_info,

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

* [PATCH v3 13/80] scsi: a100u2w: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (11 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 12/80] scsi: BusLogic: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 14/80] scsi: a2091: " Bart Van Assche
                   ` (68 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/a100u2w.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c
index d02eb5b213d0..b95147fb18b0 100644
--- a/drivers/scsi/a100u2w.c
+++ b/drivers/scsi/a100u2w.c
@@ -1065,7 +1065,7 @@ static irqreturn_t inia100_intr(int irqno, void *devid)
 	return res;
 }
 
-static struct scsi_host_template inia100_template = {
+static const struct scsi_host_template inia100_template = {
 	.proc_name		= "inia100",
 	.name			= inia100_REVID,
 	.queuecommand		= inia100_queue,

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

* [PATCH v3 14/80] scsi: a2091: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (12 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 13/80] scsi: a100u2w: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 15/80] scsi: a3000: " Bart Van Assche
                   ` (67 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/a2091.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/a2091.c b/drivers/scsi/a2091.c
index 74312400468b..204448bfd04b 100644
--- a/drivers/scsi/a2091.c
+++ b/drivers/scsi/a2091.c
@@ -180,7 +180,7 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
 	}
 }
 
-static struct scsi_host_template a2091_scsi_template = {
+static const struct scsi_host_template a2091_scsi_template = {
 	.module			= THIS_MODULE,
 	.name			= "Commodore A2091/A590 SCSI",
 	.show_info		= wd33c93_show_info,

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

* [PATCH v3 15/80] scsi: a3000: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (13 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 14/80] scsi: a2091: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 16/80] scsi: aacraid: " Bart Van Assche
                   ` (66 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/a3000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c
index 2c5cb1a02e86..c3028726bbe4 100644
--- a/drivers/scsi/a3000.c
+++ b/drivers/scsi/a3000.c
@@ -197,7 +197,7 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
 	}
 }
 
-static struct scsi_host_template amiga_a3000_scsi_template = {
+static const struct scsi_host_template amiga_a3000_scsi_template = {
 	.module			= THIS_MODULE,
 	.name			= "Amiga 3000 built-in SCSI",
 	.show_info		= wd33c93_show_info,

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

* [PATCH v3 16/80] scsi: aacraid: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (14 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 15/80] scsi: a3000: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 17/80] scsi: advansys: " Bart Van Assche
                   ` (65 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Adaptec OEM Raid Solutions,
	James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/aacraid/linit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 43160bf4d6a8..68f4dbcfff49 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -1475,7 +1475,7 @@ static const struct file_operations aac_cfg_fops = {
 	.llseek		= noop_llseek,
 };
 
-static struct scsi_host_template aac_driver_template = {
+static const struct scsi_host_template aac_driver_template = {
 	.module				= THIS_MODULE,
 	.name				= "AAC",
 	.proc_name			= AAC_DRIVERNAME,

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

* [PATCH v3 17/80] scsi: advansys: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (15 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 16/80] scsi: aacraid: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 18/80] scsi: aha152x: " Bart Van Assche
                   ` (64 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Matthew Wilcox, Hannes Reinecke,
	James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/advansys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index f301aec044bb..ab066bb27a57 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -10602,7 +10602,7 @@ static int AdvInitGetConfig(struct pci_dev *pdev, struct Scsi_Host *shost)
 }
 #endif
 
-static struct scsi_host_template advansys_template = {
+static const struct scsi_host_template advansys_template = {
 	.proc_name = DRV_NAME,
 #ifdef CONFIG_PROC_FS
 	.show_info = advansys_show_info,

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

* [PATCH v3 18/80] scsi: aha152x: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (16 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 17/80] scsi: advansys: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 19/80] scsi: aha1542: " Bart Van Assche
                   ` (63 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Juergen E. Fischer, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/aha152x.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index caeebfb67149..055adb349b0e 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -400,7 +400,7 @@ MODULE_DEVICE_TABLE(isapnp, id_table);
 
 #endif /* !AHA152X_PCMCIA */
 
-static struct scsi_host_template aha152x_driver_template;
+static const struct scsi_host_template aha152x_driver_template;
 
 /*
  * internal states of the host
@@ -2946,7 +2946,7 @@ static int aha152x_adjust_queue(struct scsi_device *device)
 	return 0;
 }
 
-static struct scsi_host_template aha152x_driver_template = {
+static const struct scsi_host_template aha152x_driver_template = {
 	.module				= THIS_MODULE,
 	.name				= AHA152X_REVID,
 	.proc_name			= "aha152x",

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

* [PATCH v3 19/80] scsi: aha1542: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (17 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 18/80] scsi: aha152x: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 20/80] scsi: aic94xx: " Bart Van Assche
                   ` (62 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/aha1542.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 552ca95157da..9503996c6325 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -737,7 +737,8 @@ static void aha1542_set_bus_times(struct Scsi_Host *sh, int bus_on, int bus_off,
 }
 
 /* return non-zero on detection */
-static struct Scsi_Host *aha1542_hw_init(struct scsi_host_template *tpnt, struct device *pdev, int indx)
+static struct Scsi_Host *aha1542_hw_init(const struct scsi_host_template *tpnt,
+					 struct device *pdev, int indx)
 {
 	unsigned int base_io = io[indx];
 	struct Scsi_Host *sh;
@@ -1031,7 +1032,7 @@ static int aha1542_exit_cmd_priv(struct Scsi_Host *shost, struct scsi_cmnd *cmd)
 	return 0;
 }
 
-static struct scsi_host_template driver_template = {
+static const struct scsi_host_template driver_template = {
 	.module			= THIS_MODULE,
 	.proc_name		= "aha1542",
 	.name			= "Adaptec 1542",

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

* [PATCH v3 20/80] scsi: aic94xx: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (18 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 19/80] scsi: aha1542: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 21/80] scsi: arcmsr: " Bart Van Assche
                   ` (61 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/aic94xx/aic94xx_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 954d0c5ae2e2..f7f81f6c3fbf 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -35,7 +35,7 @@ static struct scsi_transport_template *aic94xx_transport_template;
 static int asd_scan_finished(struct Scsi_Host *, unsigned long);
 static void asd_scan_start(struct Scsi_Host *);
 
-static struct scsi_host_template aic94xx_sht = {
+static const struct scsi_host_template aic94xx_sht = {
 	.module			= THIS_MODULE,
 	/* .name is initialized */
 	.name			= "aic94xx",

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

* [PATCH v3 21/80] scsi: arcmsr: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (19 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 20/80] scsi: aic94xx: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 22/80] scsi: acornscsi: " Bart Van Assche
                   ` (60 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley, Bjorn Helgaas

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/arcmsr/arcmsr_hba.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index 9d04cb6e62fa..b4242b1bd7b7 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -151,7 +151,7 @@ static int arcmsr_adjust_disk_queue_depth(struct scsi_device *sdev, int queue_de
 	return scsi_change_queue_depth(sdev, queue_depth);
 }
 
-static struct scsi_host_template arcmsr_scsi_host_template = {
+static const struct scsi_host_template arcmsr_scsi_host_template = {
 	.module			= THIS_MODULE,
 	.name			= "Areca SAS/SATA RAID driver",
 	.info			= arcmsr_info,

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

* [PATCH v3 22/80] scsi: acornscsi: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (20 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 21/80] scsi: arcmsr: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 23/80] scsi: arxescsi: " Bart Van Assche
                   ` (59 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Russell King, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/arm/acornscsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c
index 7602639da9b3..0b046e4b395c 100644
--- a/drivers/scsi/arm/acornscsi.c
+++ b/drivers/scsi/arm/acornscsi.c
@@ -2780,7 +2780,7 @@ static int acornscsi_show_info(struct seq_file *m, struct Scsi_Host *instance)
     return 0;
 }
 
-static struct scsi_host_template acornscsi_template = {
+static const struct scsi_host_template acornscsi_template = {
 	.module			= THIS_MODULE,
 	.show_info		= acornscsi_show_info,
 	.name			= "AcornSCSI",

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

* [PATCH v3 23/80] scsi: arxescsi: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (21 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 22/80] scsi: acornscsi: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 24/80] scsi: aha1740: " Bart Van Assche
                   ` (58 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Russell King, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/arm/arxescsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/arm/arxescsi.c b/drivers/scsi/arm/arxescsi.c
index 2527b542bcdd..925d0bd68aa5 100644
--- a/drivers/scsi/arm/arxescsi.c
+++ b/drivers/scsi/arm/arxescsi.c
@@ -238,7 +238,7 @@ arxescsi_show_info(struct seq_file *m, struct Scsi_Host *host)
 	return 0;
 }
 
-static struct scsi_host_template arxescsi_template = {
+static const struct scsi_host_template arxescsi_template = {
 	.show_info			= arxescsi_show_info,
 	.name				= "ARXE SCSI card",
 	.info				= arxescsi_info,

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

* [PATCH v3 24/80] scsi: aha1740: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (22 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 23/80] scsi: arxescsi: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 25/80] scsi: cumana: " Bart Van Assche
                   ` (57 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/aha1740.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/aha1740.c b/drivers/scsi/aha1740.c
index 134255751819..3d18945abaf7 100644
--- a/drivers/scsi/aha1740.c
+++ b/drivers/scsi/aha1740.c
@@ -543,7 +543,7 @@ static int aha1740_eh_abort_handler (struct scsi_cmnd *dummy)
 	return SUCCESS;
 }
 
-static struct scsi_host_template aha1740_template = {
+static const struct scsi_host_template aha1740_template = {
 	.module           = THIS_MODULE,
 	.proc_name        = "aha1740",
 	.show_info        = aha1740_show_info,

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

* [PATCH v3 25/80] scsi: cumana: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (23 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 24/80] scsi: aha1740: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 26/80] scsi: eesox: " Bart Van Assche
                   ` (56 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Finn Thain, Michael Schmitz,
	Russell King, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/arm/cumana_1.c | 2 +-
 drivers/scsi/arm/cumana_2.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/arm/cumana_1.c b/drivers/scsi/arm/cumana_1.c
index 5d4f67ba74c0..d1a2a22ffe8c 100644
--- a/drivers/scsi/arm/cumana_1.c
+++ b/drivers/scsi/arm/cumana_1.c
@@ -211,7 +211,7 @@ static void cumanascsi_write(struct NCR5380_hostdata *hostdata,
 
 #include "../NCR5380.c"
 
-static struct scsi_host_template cumanascsi_template = {
+static const struct scsi_host_template cumanascsi_template = {
 	.module			= THIS_MODULE,
 	.name			= "Cumana 16-bit SCSI",
 	.info			= cumanascsi_info,
diff --git a/drivers/scsi/arm/cumana_2.c b/drivers/scsi/arm/cumana_2.c
index d15053f02472..c5d8f4313b31 100644
--- a/drivers/scsi/arm/cumana_2.c
+++ b/drivers/scsi/arm/cumana_2.c
@@ -356,7 +356,7 @@ static int cumanascsi_2_show_info(struct seq_file *m, struct Scsi_Host *host)
 	return 0;
 }
 
-static struct scsi_host_template cumanascsi2_template = {
+static const struct scsi_host_template cumanascsi2_template = {
 	.module				= THIS_MODULE,
 	.show_info			= cumanascsi_2_show_info,
 	.write_info			= cumanascsi_2_set_proc_info,

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

* [PATCH v3 26/80] scsi: eesox: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (24 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 25/80] scsi: cumana: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 27/80] scsi: oak: " Bart Van Assche
                   ` (55 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Russell King, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/arm/eesox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/arm/eesox.c b/drivers/scsi/arm/eesox.c
index 6f374af9f45f..b3ec7635bc72 100644
--- a/drivers/scsi/arm/eesox.c
+++ b/drivers/scsi/arm/eesox.c
@@ -473,7 +473,7 @@ static ssize_t eesoxscsi_store_term(struct device *dev, struct device_attribute
 static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR,
 		   eesoxscsi_show_term, eesoxscsi_store_term);
 
-static struct scsi_host_template eesox_template = {
+static const struct scsi_host_template eesox_template = {
 	.module				= THIS_MODULE,
 	.show_info			= eesoxscsi_show_info,
 	.write_info			= eesoxscsi_set_proc_info,

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

* [PATCH v3 27/80] scsi: oak: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (25 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 26/80] scsi: eesox: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 28/80] scsi: powertec: " Bart Van Assche
                   ` (54 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Finn Thain, Michael Schmitz,
	Russell King, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/arm/oak.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/arm/oak.c b/drivers/scsi/arm/oak.c
index f18a0620c808..d69245007096 100644
--- a/drivers/scsi/arm/oak.c
+++ b/drivers/scsi/arm/oak.c
@@ -100,7 +100,7 @@ printk("reading %p len %d\n", addr, len);
 
 #include "../NCR5380.c"
 
-static struct scsi_host_template oakscsi_template = {
+static const struct scsi_host_template oakscsi_template = {
 	.module			= THIS_MODULE,
 	.name			= "Oak 16-bit SCSI",
 	.info			= oakscsi_info,

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

* [PATCH v3 28/80] scsi: powertec: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (26 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 27/80] scsi: oak: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 29/80] scsi: atp870u: " Bart Van Assche
                   ` (53 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Russell King, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/arm/powertec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/arm/powertec.c b/drivers/scsi/arm/powertec.c
index 7586d2a03812..3b5991427886 100644
--- a/drivers/scsi/arm/powertec.c
+++ b/drivers/scsi/arm/powertec.c
@@ -279,7 +279,7 @@ powertecscsi_store_term(struct device *dev, struct device_attribute *attr, const
 static DEVICE_ATTR(bus_term, S_IRUGO | S_IWUSR,
 		   powertecscsi_show_term, powertecscsi_store_term);
 
-static struct scsi_host_template powertecscsi_template = {
+static const struct scsi_host_template powertecscsi_template = {
 	.module				= THIS_MODULE,
 	.show_info			= powertecscsi_show_info,
 	.write_info			= powertecscsi_set_proc_info,

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

* [PATCH v3 29/80] scsi: atp870u: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (27 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 28/80] scsi: powertec: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 30/80] scsi: dc395x: " Bart Van Assche
                   ` (52 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/atp870u.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c
index 7143418d690f..2a748af269c2 100644
--- a/drivers/scsi/atp870u.c
+++ b/drivers/scsi/atp870u.c
@@ -40,7 +40,7 @@
 
 #include "atp870u.h"
 
-static struct scsi_host_template atp870u_template;
+static const struct scsi_host_template atp870u_template;
 static void send_s870(struct atp_unit *dev,unsigned char c);
 static void atp_is(struct atp_unit *dev, unsigned char c, bool wide_chip,
 		   unsigned char lvdmode);
@@ -1726,7 +1726,7 @@ static void atp870u_remove (struct pci_dev *pdev)
 }
 MODULE_LICENSE("GPL");
 
-static struct scsi_host_template atp870u_template = {
+static const struct scsi_host_template atp870u_template = {
      .module			= THIS_MODULE,
      .name			= "atp870u"		/* name */,
      .proc_name			= "atp870u",

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

* [PATCH v3 30/80] scsi: dc395x: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (28 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 29/80] scsi: atp870u: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-23  8:43   ` Oliver Neukum
  2023-03-22 19:54 ` [PATCH v3 31/80] scsi: dmx3191d: " Bart Van Assche
                   ` (51 subsequent siblings)
  81 siblings, 1 reply; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Oliver Neukum, Ali Akcaagac,
	Jamie Lenehan, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/dc395x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c
index 670a836a6ba1..c8e86f8a631e 100644
--- a/drivers/scsi/dc395x.c
+++ b/drivers/scsi/dc395x.c
@@ -4541,7 +4541,7 @@ static int dc395x_show_info(struct seq_file *m, struct Scsi_Host *host)
 }
 
 
-static struct scsi_host_template dc395x_driver_template = {
+static const struct scsi_host_template dc395x_driver_template = {
 	.module                 = THIS_MODULE,
 	.proc_name              = DC395X_NAME,
 	.show_info              = dc395x_show_info,

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

* [PATCH v3 31/80] scsi: dmx3191d: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (29 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 30/80] scsi: dc395x: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 32/80] scsi: elx: efct: " Bart Van Assche
                   ` (50 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Finn Thain, Michael Schmitz,
	James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/dmx3191d.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/dmx3191d.c b/drivers/scsi/dmx3191d.c
index a171ce6b70b2..dfb091d34363 100644
--- a/drivers/scsi/dmx3191d.c
+++ b/drivers/scsi/dmx3191d.c
@@ -39,7 +39,7 @@
 #define DMX3191D_REGION_LEN	8
 
 
-static struct scsi_host_template dmx3191d_driver_template = {
+static const struct scsi_host_template dmx3191d_driver_template = {
 	.module			= THIS_MODULE,
 	.proc_name		= DMX3191D_DRIVER_NAME,
 	.name			= "Domex DMX3191D",

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

* [PATCH v3 32/80] scsi: elx: efct: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (30 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 31/80] scsi: dmx3191d: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 33/80] scsi: esas2r: " Bart Van Assche
                   ` (49 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, James Smart, Ram Vegesna,
	James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/elx/efct/efct_xport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/elx/efct/efct_xport.c b/drivers/scsi/elx/efct/efct_xport.c
index 9495cedcc0b9..cf4dced20b8b 100644
--- a/drivers/scsi/elx/efct/efct_xport.c
+++ b/drivers/scsi/elx/efct/efct_xport.c
@@ -10,7 +10,7 @@
 static struct dentry *efct_debugfs_root;
 static atomic_t efct_debugfs_count;
 
-static struct scsi_host_template efct_template = {
+static const struct scsi_host_template efct_template = {
 	.module			= THIS_MODULE,
 	.name			= EFCT_DRIVER_NAME,
 	.supported_mode		= MODE_TARGET,

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

* [PATCH v3 33/80] scsi: esas2r: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (31 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 32/80] scsi: elx: efct: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 34/80] scsi: esp_scsi: " Bart Van Assche
                   ` (48 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Bradley Grove, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/esas2r/esas2r_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c
index d7a2c49ff5ee..f700a16cd885 100644
--- a/drivers/scsi/esas2r/esas2r_main.c
+++ b/drivers/scsi/esas2r/esas2r_main.c
@@ -231,7 +231,7 @@ struct bin_attribute bin_attr_default_nvram = {
 	.write	= NULL
 };
 
-static struct scsi_host_template driver_template = {
+static const struct scsi_host_template driver_template = {
 	.module				= THIS_MODULE,
 	.show_info			= esas2r_show_info,
 	.name				= ESAS2R_LONGNAME,

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

* [PATCH v3 34/80] scsi: esp_scsi: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (32 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 33/80] scsi: esas2r: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 35/80] scsi: fcoe: " Bart Van Assche
                   ` (47 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Hannes Reinecke, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/am53c974.c  | 2 +-
 drivers/scsi/esp_scsi.c  | 2 +-
 drivers/scsi/esp_scsi.h  | 2 +-
 drivers/scsi/jazz_esp.c  | 2 +-
 drivers/scsi/mac_esp.c   | 2 +-
 drivers/scsi/sun3x_esp.c | 2 +-
 drivers/scsi/sun_esp.c   | 2 +-
 drivers/scsi/zorro_esp.c | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/am53c974.c b/drivers/scsi/am53c974.c
index b69edb473295..fbb29dbb1e50 100644
--- a/drivers/scsi/am53c974.c
+++ b/drivers/scsi/am53c974.c
@@ -371,7 +371,7 @@ static void dc390_check_eeprom(struct esp *esp)
 static int pci_esp_probe_one(struct pci_dev *pdev,
 			      const struct pci_device_id *id)
 {
-	struct scsi_host_template *hostt = &scsi_esp_template;
+	const struct scsi_host_template *hostt = &scsi_esp_template;
 	int err = -ENODEV;
 	struct Scsi_Host *shost;
 	struct esp *esp;
diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c
index 64ec6bb84550..97816a0e6240 100644
--- a/drivers/scsi/esp_scsi.c
+++ b/drivers/scsi/esp_scsi.c
@@ -2660,7 +2660,7 @@ static const char *esp_info(struct Scsi_Host *host)
 	return "esp";
 }
 
-struct scsi_host_template scsi_esp_template = {
+const struct scsi_host_template scsi_esp_template = {
 	.module			= THIS_MODULE,
 	.name			= "esp",
 	.info			= esp_info,
diff --git a/drivers/scsi/esp_scsi.h b/drivers/scsi/esp_scsi.h
index c73760d3cf83..00cd7c0ccc76 100644
--- a/drivers/scsi/esp_scsi.h
+++ b/drivers/scsi/esp_scsi.h
@@ -572,7 +572,7 @@ struct esp {
  * 13) Check scsi_esp_register() return value, release all resources
  *     if an error was returned.
  */
-extern struct scsi_host_template scsi_esp_template;
+extern const struct scsi_host_template scsi_esp_template;
 extern int scsi_esp_register(struct esp *);
 
 extern void scsi_esp_unregister(struct esp *);
diff --git a/drivers/scsi/jazz_esp.c b/drivers/scsi/jazz_esp.c
index 60a88a95a8e2..0c842fb29aa0 100644
--- a/drivers/scsi/jazz_esp.c
+++ b/drivers/scsi/jazz_esp.c
@@ -104,7 +104,7 @@ static const struct esp_driver_ops jazz_esp_ops = {
 
 static int esp_jazz_probe(struct platform_device *dev)
 {
-	struct scsi_host_template *tpnt = &scsi_esp_template;
+	const struct scsi_host_template *tpnt = &scsi_esp_template;
 	struct Scsi_Host *host;
 	struct esp *esp;
 	struct resource *res;
diff --git a/drivers/scsi/mac_esp.c b/drivers/scsi/mac_esp.c
index 6d23ab5aee56..3f0061b00494 100644
--- a/drivers/scsi/mac_esp.c
+++ b/drivers/scsi/mac_esp.c
@@ -289,7 +289,7 @@ static struct esp_driver_ops mac_esp_ops = {
 
 static int esp_mac_probe(struct platform_device *dev)
 {
-	struct scsi_host_template *tpnt = &scsi_esp_template;
+	const struct scsi_host_template *tpnt = &scsi_esp_template;
 	struct Scsi_Host *host;
 	struct esp *esp;
 	int err;
diff --git a/drivers/scsi/sun3x_esp.c b/drivers/scsi/sun3x_esp.c
index d3489ac7ab28..30f67cbf4a7a 100644
--- a/drivers/scsi/sun3x_esp.c
+++ b/drivers/scsi/sun3x_esp.c
@@ -169,7 +169,7 @@ static const struct esp_driver_ops sun3x_esp_ops = {
 
 static int esp_sun3x_probe(struct platform_device *dev)
 {
-	struct scsi_host_template *tpnt = &scsi_esp_template;
+	const struct scsi_host_template *tpnt = &scsi_esp_template;
 	struct Scsi_Host *host;
 	struct esp *esp;
 	struct resource *res;
diff --git a/drivers/scsi/sun_esp.c b/drivers/scsi/sun_esp.c
index 58bdd71fef06..d06e933191a2 100644
--- a/drivers/scsi/sun_esp.c
+++ b/drivers/scsi/sun_esp.c
@@ -451,7 +451,7 @@ static const struct esp_driver_ops sbus_esp_ops = {
 static int esp_sbus_probe_one(struct platform_device *op,
 			      struct platform_device *espdma, int hme)
 {
-	struct scsi_host_template *tpnt = &scsi_esp_template;
+	const struct scsi_host_template *tpnt = &scsi_esp_template;
 	struct Scsi_Host *host;
 	struct esp *esp;
 	int err;
diff --git a/drivers/scsi/zorro_esp.c b/drivers/scsi/zorro_esp.c
index 928c8adf5cb3..56cae22a4242 100644
--- a/drivers/scsi/zorro_esp.c
+++ b/drivers/scsi/zorro_esp.c
@@ -713,7 +713,7 @@ MODULE_DEVICE_TABLE(zorro, zorro_esp_zorro_tbl);
 static int zorro_esp_probe(struct zorro_dev *z,
 				       const struct zorro_device_id *ent)
 {
-	struct scsi_host_template *tpnt = &scsi_esp_template;
+	const struct scsi_host_template *tpnt = &scsi_esp_template;
 	struct Scsi_Host *host;
 	struct esp *esp;
 	const struct zorro_driver_data *zdd;

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

* [PATCH v3 35/80] scsi: fcoe: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (33 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 34/80] scsi: esp_scsi: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 36/80] scsi: fnic: Declare " Bart Van Assche
                   ` (46 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Hannes Reinecke, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/fcoe/fcoe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 38774a272e62..f1429f270170 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -260,7 +260,7 @@ static struct fc_function_template fcoe_vport_fc_functions = {
 	.bsg_request = fc_lport_bsg_request,
 };
 
-static struct scsi_host_template fcoe_shost_template = {
+static const struct scsi_host_template fcoe_shost_template = {
 	.module = THIS_MODULE,
 	.name = "FCoE Driver",
 	.proc_name = FCOE_NAME,

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

* [PATCH v3 36/80] scsi: fnic: Declare host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (34 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 35/80] scsi: fcoe: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 37/80] scsi: qedf: " Bart Van Assche
                   ` (45 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Satish Kharat, Sesidhar Baddela,
	Karan Tilak Kumar, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/fnic/fnic_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
index 1077110ab273..984bc5fc55e2 100644
--- a/drivers/scsi/fnic/fnic_main.c
+++ b/drivers/scsi/fnic/fnic_main.c
@@ -95,7 +95,7 @@ static int fnic_slave_alloc(struct scsi_device *sdev)
 	return 0;
 }
 
-static struct scsi_host_template fnic_host_template = {
+static const struct scsi_host_template fnic_host_template = {
 	.module = THIS_MODULE,
 	.name = DRV_NAME,
 	.queuecommand = fnic_queuecommand,

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

* [PATCH v3 37/80] scsi: qedf: Declare host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (35 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 36/80] scsi: fnic: Declare " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 38/80] scsi: fdomain: Declare SCSI " Bart Van Assche
                   ` (44 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Saurav Kashyap, Javed Hasan,
	GR-QLogic-Storage-Upstream, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/qedf/qedf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 35e16600fc63..e7f2560b9f7d 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -979,7 +979,7 @@ static int qedf_slave_configure(struct scsi_device *sdev)
 	return 0;
 }
 
-static struct scsi_host_template qedf_host_template = {
+static const struct scsi_host_template qedf_host_template = {
 	.module 	= THIS_MODULE,
 	.name 		= QEDF_MODULE_NAME,
 	.this_id 	= -1,

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

* [PATCH v3 38/80] scsi: fdomain: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (36 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 37/80] scsi: qedf: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 39/80] scsi: NCR5380: " Bart Van Assche
                   ` (43 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/fdomain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c
index 444eac9b2466..504c4e0c5d17 100644
--- a/drivers/scsi/fdomain.c
+++ b/drivers/scsi/fdomain.c
@@ -496,7 +496,7 @@ static int fdomain_biosparam(struct scsi_device *sdev,
 	return 0;
 }
 
-static struct scsi_host_template fdomain_template = {
+static const struct scsi_host_template fdomain_template = {
 	.module			= THIS_MODULE,
 	.name			= "Future Domain TMC-16x0",
 	.proc_name		= "fdomain",

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

* [PATCH v3 39/80] scsi: NCR5380: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (37 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 38/80] scsi: fdomain: Declare SCSI " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 40/80] scsi: gvp11: " Bart Van Assche
                   ` (42 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Finn Thain, Michael Schmitz,
	James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/g_NCR5380.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index 0c768e7d06b9..f6305e3e60f4 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -219,7 +219,7 @@ static int hp_c2502_irqs[] = {
 	9, 5, 7, 3, 4, -1
 };
 
-static int generic_NCR5380_init_one(struct scsi_host_template *tpnt,
+static int generic_NCR5380_init_one(const struct scsi_host_template *tpnt,
 			struct device *pdev, int base, int irq, int board)
 {
 	bool is_pmio = base <= 0xffff;
@@ -689,7 +689,7 @@ static int generic_NCR5380_dma_residual(struct NCR5380_hostdata *hostdata)
 
 #include "NCR5380.c"
 
-static struct scsi_host_template driver_template = {
+static const struct scsi_host_template driver_template = {
 	.module			= THIS_MODULE,
 	.proc_name		= DRV_MODULE_NAME,
 	.name			= "Generic NCR5380/NCR53C400 SCSI",

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

* [PATCH v3 40/80] scsi: gvp11: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (38 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 39/80] scsi: NCR5380: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 41/80] scsi: hisi_sas: " Bart Van Assche
                   ` (41 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/gvp11.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/gvp11.c b/drivers/scsi/gvp11.c
index 7d56a236a011..d2eddad099a2 100644
--- a/drivers/scsi/gvp11.c
+++ b/drivers/scsi/gvp11.c
@@ -222,7 +222,7 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
 	}
 }
 
-static struct scsi_host_template gvp11_scsi_template = {
+static const struct scsi_host_template gvp11_scsi_template = {
 	.module			= THIS_MODULE,
 	.name			= "GVP Series II SCSI",
 	.show_info		= wd33c93_show_info,

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

* [PATCH v3 41/80] scsi: hisi_sas: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (39 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 40/80] scsi: gvp11: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 42/80] scsi: hpsa: " Bart Van Assche
                   ` (40 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Xiang Chen, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Acked-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 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 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h
index 3a5fc3658d3a..7e375499e680 100644
--- a/drivers/scsi/hisi_sas/hisi_sas.h
+++ b/drivers/scsi/hisi_sas/hisi_sas.h
@@ -345,7 +345,7 @@ struct hisi_sas_hw {
 					   int delay_ms, int timeout_ms);
 	void (*debugfs_snapshot_regs)(struct hisi_hba *hisi_hba);
 	int complete_hdr_size;
-	struct scsi_host_template *sht;
+	const struct scsi_host_template *sht;
 };
 
 #define HISI_SAS_MAX_DEBUGFS_DUMP (50)
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
index d643c5a49aa9..98c978df84d6 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
@@ -1735,7 +1735,7 @@ static struct attribute *host_v1_hw_attrs[] = {
 
 ATTRIBUTE_GROUPS(host_v1_hw);
 
-static struct scsi_host_template sht_v1_hw = {
+static const struct scsi_host_template sht_v1_hw = {
 	.name			= DRV_NAME,
 	.proc_name		= DRV_NAME,
 	.module			= THIS_MODULE,
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index cded42f4ca44..95de3e2caaee 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -3551,7 +3551,7 @@ static void map_queues_v2_hw(struct Scsi_Host *shost)
 	}
 }
 
-static struct scsi_host_template sht_v2_hw = {
+static const struct scsi_host_template sht_v2_hw = {
 	.name			= DRV_NAME,
 	.proc_name		= DRV_NAME,
 	.module			= THIS_MODULE,
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
index 8d0e2dd6207a..c55bef584a9b 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
@@ -3282,7 +3282,7 @@ static void hisi_sas_map_queues(struct Scsi_Host *shost)
 	}
 }
 
-static struct scsi_host_template sht_v3_hw = {
+static const struct scsi_host_template sht_v3_hw = {
 	.name			= DRV_NAME,
 	.proc_name		= DRV_NAME,
 	.module			= THIS_MODULE,

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

* [PATCH v3 42/80] scsi: hpsa: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (40 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 41/80] scsi: hisi_sas: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 43/80] scsi: hptiop: " Bart Van Assche
                   ` (39 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Don Brace, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/hpsa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index fec7e17747f7..9fab57852609 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -967,7 +967,7 @@ ATTRIBUTE_GROUPS(hpsa_shost);
 #define HPSA_NRESERVED_CMDS	(HPSA_CMDS_RESERVED_FOR_DRIVER +\
 				 HPSA_MAX_CONCURRENT_PASSTHRUS)
 
-static struct scsi_host_template hpsa_driver_template = {
+static const struct scsi_host_template hpsa_driver_template = {
 	.module			= THIS_MODULE,
 	.name			= HPSA,
 	.proc_name		= HPSA,

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

* [PATCH v3 43/80] scsi: hptiop: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (41 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 42/80] scsi: hpsa: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 44/80] scsi: ibmvfc: " Bart Van Assche
                   ` (38 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, HighPoint Linux Team, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/hptiop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c
index 7e8903718245..06ccb51bf6a9 100644
--- a/drivers/scsi/hptiop.c
+++ b/drivers/scsi/hptiop.c
@@ -1159,7 +1159,7 @@ static int hptiop_slave_config(struct scsi_device *sdev)
 	return 0;
 }
 
-static struct scsi_host_template driver_template = {
+static const struct scsi_host_template driver_template = {
 	.module                     = THIS_MODULE,
 	.name                       = driver_name,
 	.queuecommand               = hptiop_queuecommand,

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

* [PATCH v3 44/80] scsi: ibmvfc: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (42 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 43/80] scsi: hptiop: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 45/80] scsi: imm: " Bart Van Assche
                   ` (37 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Tyrel Datwyler, Michael Ellerman,
	James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Acked-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/ibmvscsi/ibmvfc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 1a0c0b7289d2..ce9eb00e2ca0 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -3611,7 +3611,7 @@ static struct attribute *ibmvfc_host_attrs[] = {
 
 ATTRIBUTE_GROUPS(ibmvfc_host);
 
-static struct scsi_host_template driver_template = {
+static const struct scsi_host_template driver_template = {
 	.module = THIS_MODULE,
 	.name = "IBM POWER Virtual FC Adapter",
 	.proc_name = IBMVFC_NAME,

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

* [PATCH v3 45/80] scsi: imm: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (43 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 44/80] scsi: ibmvfc: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 46/80] scsi: initio: " Bart Van Assche
                   ` (36 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/imm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/imm.c b/drivers/scsi/imm.c
index 7a499d621c25..07db98161a03 100644
--- a/drivers/scsi/imm.c
+++ b/drivers/scsi/imm.c
@@ -1096,7 +1096,7 @@ static int imm_adjust_queue(struct scsi_device *device)
 	return 0;
 }
 
-static struct scsi_host_template imm_template = {
+static const struct scsi_host_template imm_template = {
 	.module			= THIS_MODULE,
 	.proc_name		= "imm",
 	.show_info		= imm_show_info,

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

* [PATCH v3 46/80] scsi: initio: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (44 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 45/80] scsi: imm: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 47/80] scsi: ipr: " Bart Van Assche
                   ` (35 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/initio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index 375261d67619..2a50fda3a628 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -2788,7 +2788,7 @@ static void i91uSCBPost(u8 * host_mem, u8 * cblk_mem)
 	initio_release_scb(host, cblk);	/* Release SCB for current channel */
 }
 
-static struct scsi_host_template initio_template = {
+static const struct scsi_host_template initio_template = {
 	.proc_name		= "INI9100U",
 	.name			= "Initio INI-9X00U/UW SCSI device driver",
 	.queuecommand		= i91u_queuecommand,

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

* [PATCH v3 47/80] scsi: ipr: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (45 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 46/80] scsi: initio: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 48/80] scsi: isci: " Bart Van Assche
                   ` (34 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Brian King, Brian King,
	James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/ipr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index c74053f0b72f..4d3c280a7360 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -6736,7 +6736,7 @@ static const char *ipr_ioa_info(struct Scsi_Host *host)
 	return buffer;
 }
 
-static struct scsi_host_template driver_template = {
+static const struct scsi_host_template driver_template = {
 	.module = THIS_MODULE,
 	.name = "IPR",
 	.info = ipr_ioa_info,

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

* [PATCH v3 48/80] scsi: isci: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (46 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 47/80] scsi: ipr: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 49/80] scsi: iscsi: " Bart Van Assche
                   ` (33 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Artur Paszkiewicz, James E.J. Bottomley

Make it explicit that the ISCI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/isci/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c
index e294d5d961eb..ac1e04b86d8f 100644
--- a/drivers/scsi/isci/init.c
+++ b/drivers/scsi/isci/init.c
@@ -149,7 +149,7 @@ static struct attribute *isci_host_attrs[] = {
 
 ATTRIBUTE_GROUPS(isci_host);
 
-static struct scsi_host_template isci_sht = {
+static const struct scsi_host_template isci_sht = {
 
 	.module				= THIS_MODULE,
 	.name				= DRV_NAME,

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

* [PATCH v3 49/80] scsi: iscsi: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (47 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 48/80] scsi: isci: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 50/80] scsi: mac53c94: " Bart Van Assche
                   ` (32 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Mike Christie, Sagi Grimberg,
	Max Gurtovoy, Jason Gunthorpe, Leon Romanovsky, Ketan Mukadam,
	James E.J. Bottomley, Nilesh Javali, Manish Rangankar,
	GR-QLogic-Storage-Upstream, Varun Prakash, Lee Duncan,
	Chris Leech, Wu Bo, Jesper Juhl

Make it explicit that the SCSI host template is not modified.

Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/infiniband/ulp/iser/iscsi_iser.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/iscsi_tcp.c                 | 4 ++--
 drivers/scsi/libiscsi.c                  | 2 +-
 drivers/scsi/qedi/qedi_gbl.h             | 2 +-
 drivers/scsi/qedi/qedi_iscsi.c           | 2 +-
 include/scsi/libiscsi.h                  | 2 +-
 11 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 6b7603765383..bb9aaff92ca3 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -78,7 +78,7 @@ MODULE_DESCRIPTION("iSER (iSCSI Extensions for RDMA) Datamover");
 MODULE_LICENSE("Dual BSD/GPL");
 MODULE_AUTHOR("Alex Nezhinsky, Dan Bar Dov, Or Gerlitz");
 
-static struct scsi_host_template iscsi_iser_sht;
+static const struct scsi_host_template iscsi_iser_sht;
 static struct iscsi_transport iscsi_iser_transport;
 static struct scsi_transport_template *iscsi_iser_scsi_transport;
 static struct workqueue_struct *release_wq;
@@ -956,7 +956,7 @@ static umode_t iser_attr_is_visible(int param_type, int param)
 	return 0;
 }
 
-static struct scsi_host_template iscsi_iser_sht = {
+static const struct scsi_host_template iscsi_iser_sht = {
 	.module                 = THIS_MODULE,
 	.name                   = "iSCSI Initiator over iSER",
 	.queuecommand           = iscsi_queuecommand,
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 08920f5f4217..e48f14ad6dfd 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -398,7 +398,7 @@ static const struct pci_device_id beiscsi_pci_id_table[] = {
 MODULE_DEVICE_TABLE(pci, beiscsi_pci_id_table);
 
 
-static struct scsi_host_template beiscsi_sht = {
+static const struct scsi_host_template beiscsi_sht = {
 	.module = THIS_MODULE,
 	.name = "Emulex 10Gbe open-iscsi Initiator Driver",
 	.proc_name = DRV_NAME,
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
index a3c800e04a2e..9971f32a663c 100644
--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
+++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
@@ -22,7 +22,7 @@
 
 struct scsi_transport_template *bnx2i_scsi_xport_template;
 struct iscsi_transport bnx2i_iscsi_transport;
-static struct scsi_host_template bnx2i_host_template;
+static const struct scsi_host_template bnx2i_host_template;
 
 /*
  * Global endpoint resource info
@@ -2250,7 +2250,7 @@ static umode_t bnx2i_attr_is_visible(int param_type, int param)
  * 'Scsi_Host_Template' structure and 'iscsi_tranport' structure template
  * used while registering with the scsi host and iSCSI transport module.
  */
-static struct scsi_host_template bnx2i_host_template = {
+static const struct scsi_host_template bnx2i_host_template = {
 	.module			= THIS_MODULE,
 	.name			= "QLogic Offload iSCSI Initiator",
 	.proc_name		= "bnx2i",
diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
index ff9d4287937a..ec6530240707 100644
--- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
+++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
@@ -80,7 +80,7 @@ static struct cxgb3_client t3_client = {
 	.event_handler = cxgb3i_dev_event_handler,
 };
 
-static struct scsi_host_template cxgb3i_host_template = {
+static const struct scsi_host_template cxgb3i_host_template = {
 	.module		= THIS_MODULE,
 	.name		= DRV_MODULE_NAME,
 	.proc_name	= DRV_MODULE_NAME,
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
index af281e271f88..eb47c8c96d0e 100644
--- a/drivers/scsi/cxgbi/libcxgbi.c
+++ b/drivers/scsi/cxgbi/libcxgbi.c
@@ -337,7 +337,7 @@ void cxgbi_hbas_remove(struct cxgbi_device *cdev)
 EXPORT_SYMBOL_GPL(cxgbi_hbas_remove);
 
 int cxgbi_hbas_add(struct cxgbi_device *cdev, u64 max_lun,
-		unsigned int max_conns, struct scsi_host_template *sht,
+		unsigned int max_conns, const struct scsi_host_template *sht,
 		struct scsi_transport_template *stt)
 {
 	struct cxgbi_hba *chba;
diff --git a/drivers/scsi/cxgbi/libcxgbi.h b/drivers/scsi/cxgbi/libcxgbi.h
index d8fc7beafa20..d92cf1dccc2f 100644
--- a/drivers/scsi/cxgbi/libcxgbi.h
+++ b/drivers/scsi/cxgbi/libcxgbi.h
@@ -591,7 +591,7 @@ struct cxgbi_device *cxgbi_device_find_by_netdev(struct net_device *, int *);
 struct cxgbi_device *cxgbi_device_find_by_netdev_rcu(struct net_device *,
 						     int *);
 int cxgbi_hbas_add(struct cxgbi_device *, u64, unsigned int,
-			struct scsi_host_template *,
+			const struct scsi_host_template *,
 			struct scsi_transport_template *);
 void cxgbi_hbas_remove(struct cxgbi_device *);
 
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index c76f82fb8b63..6df2f4041f12 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -47,7 +47,7 @@ MODULE_DESCRIPTION("iSCSI/TCP data-path");
 MODULE_LICENSE("GPL");
 
 static struct scsi_transport_template *iscsi_sw_tcp_scsi_transport;
-static struct scsi_host_template iscsi_sw_tcp_sht;
+static const struct scsi_host_template iscsi_sw_tcp_sht;
 static struct iscsi_transport iscsi_sw_tcp_transport;
 
 static unsigned int iscsi_max_lun = ~0;
@@ -1072,7 +1072,7 @@ static int iscsi_sw_tcp_slave_configure(struct scsi_device *sdev)
 	return 0;
 }
 
-static struct scsi_host_template iscsi_sw_tcp_sht = {
+static const struct scsi_host_template iscsi_sw_tcp_sht = {
 	.module			= THIS_MODULE,
 	.name			= "iSCSI Initiator over TCP/IP",
 	.queuecommand           = iscsi_queuecommand,
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 127f3d7f19dc..0fda8905eabd 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -2895,7 +2895,7 @@ EXPORT_SYMBOL_GPL(iscsi_host_add);
  * This should be called by partial offload and software iscsi drivers.
  * To access the driver specific memory use the iscsi_host_priv() macro.
  */
-struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht,
+struct Scsi_Host *iscsi_host_alloc(const struct scsi_host_template *sht,
 				   int dd_data_size, bool xmit_can_sleep)
 {
 	struct Scsi_Host *shost;
diff --git a/drivers/scsi/qedi/qedi_gbl.h b/drivers/scsi/qedi/qedi_gbl.h
index 72942772b198..0e316cc24b19 100644
--- a/drivers/scsi/qedi/qedi_gbl.h
+++ b/drivers/scsi/qedi/qedi_gbl.h
@@ -17,7 +17,7 @@ extern int qedi_do_not_recover;
 
 extern uint qedi_io_tracing;
 
-extern struct scsi_host_template qedi_host_template;
+extern const struct scsi_host_template qedi_host_template;
 extern struct iscsi_transport qedi_iscsi_transport;
 extern const struct qed_iscsi_ops *qedi_ops;
 extern const struct qedi_debugfs_ops qedi_debugfs_ops[];
diff --git a/drivers/scsi/qedi/qedi_iscsi.c b/drivers/scsi/qedi/qedi_iscsi.c
index 31ec429104e2..6ed8ef97642c 100644
--- a/drivers/scsi/qedi/qedi_iscsi.c
+++ b/drivers/scsi/qedi/qedi_iscsi.c
@@ -40,7 +40,7 @@ static int qedi_eh_host_reset(struct scsi_cmnd *cmd)
 	return qedi_recover_all_conns(qedi);
 }
 
-struct scsi_host_template qedi_host_template = {
+const struct scsi_host_template qedi_host_template = {
 	.module = THIS_MODULE,
 	.name = "QLogic QEDI 25/40/100Gb iSCSI Initiator Driver",
 	.proc_name = QEDI_MODULE_NAME,
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index e39fb0736ade..7282555adfd5 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -407,7 +407,7 @@ extern int iscsi_host_set_param(struct Scsi_Host *shost,
 extern int iscsi_host_get_param(struct Scsi_Host *shost,
 				enum iscsi_host_param param, char *buf);
 extern int iscsi_host_add(struct Scsi_Host *shost, struct device *pdev);
-extern struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht,
+extern struct Scsi_Host *iscsi_host_alloc(const struct scsi_host_template *sht,
 					  int dd_data_size,
 					  bool xmit_can_sleep);
 extern void iscsi_host_remove(struct Scsi_Host *shost, bool is_shutdown);

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

* [PATCH v3 50/80] scsi: mac53c94: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (48 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 49/80] scsi: iscsi: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 51/80] scsi: megaraid: " Bart Van Assche
                   ` (31 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/mac53c94.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mac53c94.c b/drivers/scsi/mac53c94.c
index f75928f7773e..6a019132109c 100644
--- a/drivers/scsi/mac53c94.c
+++ b/drivers/scsi/mac53c94.c
@@ -392,7 +392,7 @@ static void set_dma_cmds(struct fsc_state *state, struct scsi_cmnd *cmd)
 	mac53c94_priv(cmd)->this_residual = total;
 }
 
-static struct scsi_host_template mac53c94_template = {
+static const struct scsi_host_template mac53c94_template = {
 	.proc_name	= "53c94",
 	.name		= "53C94",
 	.queuecommand	= mac53c94_queue,

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

* [PATCH v3 51/80] scsi: megaraid: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (49 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 50/80] scsi: mac53c94: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 52/80] scsi: mesh: " Bart Van Assche
                   ` (30 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Kashyap Desai, Sumit Saxena,
	Shivasharan S, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/megaraid.c                   | 2 +-
 drivers/scsi/megaraid/megaraid_mbox.c     | 2 +-
 drivers/scsi/megaraid/megaraid_sas_base.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
index bf491af9f0d6..3115ab991fc6 100644
--- a/drivers/scsi/megaraid.c
+++ b/drivers/scsi/megaraid.c
@@ -4100,7 +4100,7 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru)
 	return rval;
 }
 
-static struct scsi_host_template megaraid_template = {
+static const struct scsi_host_template megaraid_template = {
 	.module				= THIS_MODULE,
 	.name				= "MegaRAID",
 	.proc_name			= "megaraid_legacy",
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index 132de68c14e9..ef2b6380e19a 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -325,7 +325,7 @@ ATTRIBUTE_GROUPS(megaraid_sdev);
 /*
  * Scsi host template for megaraid unified driver
  */
-static struct scsi_host_template megaraid_template_g = {
+static const struct scsi_host_template megaraid_template_g = {
 	.module				= THIS_MODULE,
 	.name				= "LSI Logic MegaRAID driver",
 	.proc_name			= "megaraid",
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 3ceece988338..406a346cbc08 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -3505,7 +3505,7 @@ ATTRIBUTE_GROUPS(megaraid_host);
 /*
  * Scsi host template for megaraid_sas driver
  */
-static struct scsi_host_template megasas_template = {
+static const struct scsi_host_template megasas_template = {
 
 	.module = THIS_MODULE,
 	.name = "Avago SAS based MegaRAID driver",

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

* [PATCH v3 52/80] scsi: mesh: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (50 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 51/80] scsi: megaraid: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 53/80] scsi: mpi3mr: " Bart Van Assche
                   ` (29 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/mesh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mesh.c b/drivers/scsi/mesh.c
index 84b541a57b7b..e276583c590c 100644
--- a/drivers/scsi/mesh.c
+++ b/drivers/scsi/mesh.c
@@ -1830,7 +1830,7 @@ static int mesh_shutdown(struct macio_dev *mdev)
 	return 0;
 }
 
-static struct scsi_host_template mesh_template = {
+static const struct scsi_host_template mesh_template = {
 	.proc_name			= "mesh",
 	.name				= "MESH",
 	.queuecommand			= mesh_queue,

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

* [PATCH v3 53/80] scsi: mpi3mr: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (51 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 52/80] scsi: mesh: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 54/80] scsi: mpt3sas: " Bart Van Assche
                   ` (28 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Sathya Prakash Veerichetty,
	Kashyap Desai, Sumit Saxena, Sreekanth Reddy,
	James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/mpi3mr/mpi3mr_os.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 39ebaa8a0fc8..5db412ad9fd8 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -4795,7 +4795,7 @@ static int mpi3mr_qcmd(struct Scsi_Host *shost,
 	return retval;
 }
 
-static struct scsi_host_template mpi3mr_driver_template = {
+static const struct scsi_host_template mpi3mr_driver_template = {
 	.module				= THIS_MODULE,
 	.name				= "MPI3 Storage Controller",
 	.proc_name			= MPI3MR_DRIVER_NAME,

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

* [PATCH v3 54/80] scsi: mpt3sas: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (52 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 53/80] scsi: mpi3mr: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 55/80] scsi: mvme147: " Bart Van Assche
                   ` (27 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Sathya Prakash, Sreekanth Reddy,
	Suganath Prabu Subramani, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/mpt3sas/mpt3sas_scsih.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
index e2f09833659f..492d1940d596 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -11925,7 +11925,7 @@ static void scsih_map_queues(struct Scsi_Host *shost)
 }
 
 /* shost template for SAS 2.0 HBA devices */
-static struct scsi_host_template mpt2sas_driver_template = {
+static const struct scsi_host_template mpt2sas_driver_template = {
 	.module				= THIS_MODULE,
 	.name				= "Fusion MPT SAS Host",
 	.proc_name			= MPT2SAS_DRIVER_NAME,
@@ -11963,7 +11963,7 @@ static struct raid_function_template mpt2sas_raid_functions = {
 };
 
 /* shost template for SAS 3.0 HBA devices */
-static struct scsi_host_template mpt3sas_driver_template = {
+static const struct scsi_host_template mpt3sas_driver_template = {
 	.module				= THIS_MODULE,
 	.name				= "Fusion MPT SAS Host",
 	.proc_name			= MPT3SAS_DRIVER_NAME,

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

* [PATCH v3 55/80] scsi: mvme147: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (53 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 54/80] scsi: mpt3sas: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 56/80] scsi: mvsas: " Bart Van Assche
                   ` (26 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/mvme147.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mvme147.c b/drivers/scsi/mvme147.c
index 472fa043094f..98b99c0f5bc7 100644
--- a/drivers/scsi/mvme147.c
+++ b/drivers/scsi/mvme147.c
@@ -69,7 +69,7 @@ static void dma_stop(struct Scsi_Host *instance, struct scsi_cmnd *SCpnt,
 	m147_pcc->dma_cntrl = 0;
 }
 
-static struct scsi_host_template mvme147_host_template = {
+static const struct scsi_host_template mvme147_host_template = {
 	.module			= THIS_MODULE,
 	.proc_name		= "MVME147",
 	.name			= "MVME147 built-in SCSI",

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

* [PATCH v3 56/80] scsi: mvsas: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (54 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 55/80] scsi: mvme147: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 57/80] scsi: mvumi: " Bart Van Assche
                   ` (25 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, John Garry, James E.J. Bottomley,
	Alexey Galakhov, Hannes Reinecke

Make it explicit that the SCSI host template is not modified.

Reviewed-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/mvsas/mv_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c
index cfe84473a515..49e2a5e7ce54 100644
--- a/drivers/scsi/mvsas/mv_init.c
+++ b/drivers/scsi/mvsas/mv_init.c
@@ -29,7 +29,7 @@ static const struct attribute_group *mvst_host_groups[];
 
 #define SOC_SAS_NUM 2
 
-static struct scsi_host_template mvs_sht = {
+static const struct scsi_host_template mvs_sht = {
 	.module			= THIS_MODULE,
 	.name			= DRV_NAME,
 	.queuecommand		= sas_queuecommand,

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

* [PATCH v3 57/80] scsi: mvumi: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (55 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 56/80] scsi: mvsas: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 58/80] scsi: myrb: " Bart Van Assche
                   ` (24 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/mvumi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c
index 60c65586f30e..73aa7059b556 100644
--- a/drivers/scsi/mvumi.c
+++ b/drivers/scsi/mvumi.c
@@ -2168,7 +2168,7 @@ mvumi_bios_param(struct scsi_device *sdev, struct block_device *bdev,
 	return 0;
 }
 
-static struct scsi_host_template mvumi_template = {
+static const struct scsi_host_template mvumi_template = {
 
 	.module = THIS_MODULE,
 	.name = "Marvell Storage Controller",

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

* [PATCH v3 58/80] scsi: myrb: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (56 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 57/80] scsi: mvumi: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 59/80] scsi: myrs: " Bart Van Assche
                   ` (23 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Hannes Reinecke, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/myrb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/myrb.c b/drivers/scsi/myrb.c
index e885c1dbf61f..ca2e932dd9b7 100644
--- a/drivers/scsi/myrb.c
+++ b/drivers/scsi/myrb.c
@@ -2203,7 +2203,7 @@ static struct attribute *myrb_shost_attrs[] = {
 
 ATTRIBUTE_GROUPS(myrb_shost);
 
-static struct scsi_host_template myrb_template = {
+static const struct scsi_host_template myrb_template = {
 	.module			= THIS_MODULE,
 	.name			= "DAC960",
 	.proc_name		= "myrb",

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

* [PATCH v3 59/80] scsi: myrs: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (57 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 58/80] scsi: myrb: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 60/80] scsi: nsp32: " Bart Van Assche
                   ` (22 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Hannes Reinecke, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/myrs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/myrs.c b/drivers/scsi/myrs.c
index 7eb8c39da366..a1eec65a9713 100644
--- a/drivers/scsi/myrs.c
+++ b/drivers/scsi/myrs.c
@@ -1915,7 +1915,7 @@ static void myrs_slave_destroy(struct scsi_device *sdev)
 	kfree(sdev->hostdata);
 }
 
-static struct scsi_host_template myrs_template = {
+static const struct scsi_host_template myrs_template = {
 	.module			= THIS_MODULE,
 	.name			= "DAC960",
 	.proc_name		= "myrs",

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

* [PATCH v3 60/80] scsi: nsp32: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (58 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 59/80] scsi: myrs: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 61/80] scsi: pcmcia-sym53c500: " Bart Van Assche
                   ` (21 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, GOTO Masanori, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/nsp32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c
index 75bb0028ed74..b7987019686e 100644
--- a/drivers/scsi/nsp32.c
+++ b/drivers/scsi/nsp32.c
@@ -259,7 +259,7 @@ static void nsp32_dmessage(const char *, int, int,    char *, ...);
 /*
  * max_sectors is currently limited up to 128.
  */
-static struct scsi_host_template nsp32_template = {
+static const struct scsi_host_template nsp32_template = {
 	.proc_name			= "nsp32",
 	.name				= "Workbit NinjaSCSI-32Bi/UDE",
 	.show_info			= nsp32_show_info,

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

* [PATCH v3 61/80] scsi: pcmcia-sym53c500: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (59 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 60/80] scsi: nsp32: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 62/80] scsi: pcmcia-pm8001: " Bart Van Assche
                   ` (20 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley, Finn Thain

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/pcmcia/sym53c500_cs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c
index 5d7dfefd6f6c..278c78d066c4 100644
--- a/drivers/scsi/pcmcia/sym53c500_cs.c
+++ b/drivers/scsi/pcmcia/sym53c500_cs.c
@@ -668,7 +668,7 @@ ATTRIBUTE_GROUPS(SYM53C500_shost);
 /*
 *  scsi_host_template initializer
 */
-static struct scsi_host_template sym53c500_driver_template = {
+static const struct scsi_host_template sym53c500_driver_template = {
      .module			= THIS_MODULE,
      .name			= "SYM53C500",
      .info			= SYM53C500_info,
@@ -702,7 +702,7 @@ SYM53C500_config(struct pcmcia_device *link)
 	int ret;
 	int irq_level, port_base;
 	struct Scsi_Host *host;
-	struct scsi_host_template *tpnt = &sym53c500_driver_template;
+	const struct scsi_host_template *tpnt = &sym53c500_driver_template;
 	struct sym53c500_data *data;
 
 	dev_dbg(&link->dev, "SYM53C500_config\n");

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

* [PATCH v3 62/80] scsi: pcmcia-pm8001: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (60 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 61/80] scsi: pcmcia-sym53c500: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 63/80] scsi: pmcraid: " Bart Van Assche
                   ` (19 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Jack Wang, Jack Wang, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Acked-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/pm8001/pm8001_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c
index 7e589fe3e010..8b9490011e36 100644
--- a/drivers/scsi/pm8001/pm8001_init.c
+++ b/drivers/scsi/pm8001/pm8001_init.c
@@ -96,7 +96,7 @@ static void pm8001_map_queues(struct Scsi_Host *shost)
 /*
  * The main structure which LLDD must register for scsi core.
  */
-static struct scsi_host_template pm8001_sht = {
+static const struct scsi_host_template pm8001_sht = {
 	.module			= THIS_MODULE,
 	.name			= DRV_NAME,
 	.proc_name		= DRV_NAME,

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

* [PATCH v3 63/80] scsi: pmcraid: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (61 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 62/80] scsi: pcmcia-pm8001: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:54 ` [PATCH v3 64/80] scsi: ppa: " Bart Van Assche
                   ` (18 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/pmcraid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 836ddc476764..23c5230dbed4 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -3611,7 +3611,7 @@ static struct attribute *pmcraid_host_attrs[] = {
 ATTRIBUTE_GROUPS(pmcraid_host);
 
 /* host template structure for pmcraid driver */
-static struct scsi_host_template pmcraid_host_template = {
+static const struct scsi_host_template pmcraid_host_template = {
 	.module = THIS_MODULE,
 	.name = PMCRAID_DRIVER_NAME,
 	.queuecommand = pmcraid_queuecommand,

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

* [PATCH v3 64/80] scsi: ppa: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (62 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 63/80] scsi: pmcraid: " Bart Van Assche
@ 2023-03-22 19:54 ` Bart Van Assche
  2023-03-22 19:55 ` [PATCH v3 65/80] scsi: ps3rom: " Bart Van Assche
                   ` (17 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:54 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/ppa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ppa.c b/drivers/scsi/ppa.c
index c6c1bc608224..909c49541984 100644
--- a/drivers/scsi/ppa.c
+++ b/drivers/scsi/ppa.c
@@ -972,7 +972,7 @@ static int ppa_adjust_queue(struct scsi_device *device)
 	return 0;
 }
 
-static struct scsi_host_template ppa_template = {
+static const struct scsi_host_template ppa_template = {
 	.module			= THIS_MODULE,
 	.proc_name		= "ppa",
 	.show_info		= ppa_show_info,

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

* [PATCH v3 65/80] scsi: ps3rom: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (63 preceding siblings ...)
  2023-03-22 19:54 ` [PATCH v3 64/80] scsi: ppa: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2023-03-22 19:55 ` [PATCH v3 66/80] scsi: qla1280: " Bart Van Assche
                   ` (16 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Geoff Levand, James E.J. Bottomley,
	Michael Ellerman

Make it explicit that the SCSI host template is not modified.

Tested-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/ps3rom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ps3rom.c b/drivers/scsi/ps3rom.c
index 2b80cab70333..90495a832f34 100644
--- a/drivers/scsi/ps3rom.c
+++ b/drivers/scsi/ps3rom.c
@@ -323,7 +323,7 @@ static irqreturn_t ps3rom_interrupt(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-static struct scsi_host_template ps3rom_host_template = {
+static const struct scsi_host_template ps3rom_host_template = {
 	.name =			DEVICE_NAME,
 	.slave_configure =	ps3rom_slave_configure,
 	.queuecommand =		ps3rom_queuecommand,

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

* [PATCH v3 66/80] scsi: qla1280: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (64 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 65/80] scsi: ps3rom: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2023-03-22 19:55 ` [PATCH v3 67/80] scsi: qla2xxx: " Bart Van Assche
                   ` (15 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/qla1280.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 1e7f4d138e06..6e5e89aaa283 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -4115,7 +4115,7 @@ qla1280_get_token(char *str)
 }
 
 
-static struct scsi_host_template qla1280_driver_template = {
+static const struct scsi_host_template qla1280_driver_template = {
 	.module			= THIS_MODULE,
 	.proc_name		= "qla1280",
 	.name			= "Qlogic ISP 1280/12160",

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

* [PATCH v3 67/80] scsi: qla2xxx: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (65 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 66/80] scsi: qla1280: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2023-03-22 19:55 ` [PATCH v3 68/80] scsi: qlogicpti: " Bart Van Assche
                   ` (14 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Nilesh Javali,
	GR-QLogic-Storage-Upstream, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/qla2xxx/qla_gbl.h | 2 +-
 drivers/scsi/qla2xxx/qla_mid.c | 2 +-
 drivers/scsi/qla2xxx/qla_os.c  | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 9142df876c73..7bc2f634bab9 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -213,7 +213,7 @@ extern void qla2x00_free_exchoffld_buffer(struct qla_hw_data *);
 
 extern int qla81xx_restart_mpi_firmware(scsi_qla_host_t *);
 
-extern struct scsi_qla_host *qla2x00_create_host(struct scsi_host_template *,
+extern struct scsi_qla_host *qla2x00_create_host(const struct scsi_host_template *,
 	struct qla_hw_data *);
 extern void qla2x00_free_host(struct scsi_qla_host *);
 extern void qla2x00_relogin(struct scsi_qla_host *);
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index 78661b658dcd..b67416951a5f 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -496,7 +496,7 @@ qla24xx_create_vhost(struct fc_vport *fc_vport)
 	scsi_qla_host_t *base_vha = shost_priv(fc_vport->shost);
 	struct qla_hw_data *ha = base_vha->hw;
 	scsi_qla_host_t *vha;
-	struct scsi_host_template *sht = &qla2xxx_driver_template;
+	const struct scsi_host_template *sht = &qla2xxx_driver_template;
 	struct Scsi_Host *host;
 
 	vha = qla2x00_create_host(sht, ha);
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index a6c5e0d8641d..27f3e99b7818 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -4999,8 +4999,8 @@ qla2x00_mem_free(struct qla_hw_data *ha)
 	ha->vp_map = NULL;
 }
 
-struct scsi_qla_host *qla2x00_create_host(struct scsi_host_template *sht,
-						struct qla_hw_data *ha)
+struct scsi_qla_host *qla2x00_create_host(const struct scsi_host_template *sht,
+					  struct qla_hw_data *ha)
 {
 	struct Scsi_Host *host;
 	struct scsi_qla_host *vha = NULL;

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

* [PATCH v3 68/80] scsi: qlogicpti: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (66 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 67/80] scsi: qla2xxx: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2023-03-22 19:55 ` [PATCH v3 69/80] scsi: sgiwd93: " Bart Van Assche
                   ` (13 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/qlogicpti.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/qlogicpti.c b/drivers/scsi/qlogicpti.c
index bf08c7cd10ef..1e8fbd457248 100644
--- a/drivers/scsi/qlogicpti.c
+++ b/drivers/scsi/qlogicpti.c
@@ -1287,7 +1287,7 @@ static int qlogicpti_reset(struct scsi_cmnd *Cmnd)
 	return return_status;
 }
 
-static struct scsi_host_template qpti_template = {
+static const struct scsi_host_template qpti_template = {
 	.module			= THIS_MODULE,
 	.name			= "qlogicpti",
 	.info			= qlogicpti_info,

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

* [PATCH v3 69/80] scsi: sgiwd93: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (67 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 68/80] scsi: qlogicpti: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2023-03-22 19:55 ` [PATCH v3 70/80] scsi: smartpqi: " Bart Van Assche
                   ` (12 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/sgiwd93.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
index 57d5dff62f63..88e2b5eb9caa 100644
--- a/drivers/scsi/sgiwd93.c
+++ b/drivers/scsi/sgiwd93.c
@@ -204,7 +204,7 @@ static inline void init_hpc_chain(struct ip22_hostdata *hdata)
  * arguments not with pointers.  So this is going to blow up beautyfully
  * on 64-bit systems with memory outside the compat address spaces.
  */
-static struct scsi_host_template sgiwd93_template = {
+static const struct scsi_host_template sgiwd93_template = {
 	.module			= THIS_MODULE,
 	.proc_name		= "SGIWD93",
 	.name			= "SGI WD93",

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

* [PATCH v3 70/80] scsi: smartpqi: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (68 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 69/80] scsi: sgiwd93: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2023-03-22 19:55 ` [PATCH v3 71/80] scsi: snic: " Bart Van Assche
                   ` (11 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Don Brace, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/smartpqi/smartpqi_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index 49a8f91810b6..03de97cd72c2 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -7403,7 +7403,7 @@ static struct attribute *pqi_sdev_attrs[] = {
 
 ATTRIBUTE_GROUPS(pqi_sdev);
 
-static struct scsi_host_template pqi_driver_template = {
+static const struct scsi_host_template pqi_driver_template = {
 	.module = THIS_MODULE,
 	.name = DRIVER_NAME_SHORT,
 	.proc_name = DRIVER_NAME_SHORT,

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

* [PATCH v3 71/80] scsi: snic: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (69 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 70/80] scsi: smartpqi: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2023-03-22 19:55 ` [PATCH v3 72/80] scsi: stex: " Bart Van Assche
                   ` (10 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Karan Tilak Kumar, Sesidhar Baddela,
	James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/snic/snic_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/snic/snic_main.c b/drivers/scsi/snic/snic_main.c
index 174f7811fe50..cc824dcfe7da 100644
--- a/drivers/scsi/snic/snic_main.c
+++ b/drivers/scsi/snic/snic_main.c
@@ -100,7 +100,7 @@ snic_change_queue_depth(struct scsi_device *sdev, int qdepth)
 	return sdev->queue_depth;
 }
 
-static struct scsi_host_template snic_host_template = {
+static const struct scsi_host_template snic_host_template = {
 	.module = THIS_MODULE,
 	.name = SNIC_DRV_NAME,
 	.queuecommand = snic_queuecommand,

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

* [PATCH v3 72/80] scsi: stex: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (70 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 71/80] scsi: snic: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2023-03-22 19:55 ` [PATCH v3 73/80] scsi: sym53c8xx: " Bart Van Assche
                   ` (9 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/stex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index 8def242675ef..5b230e149c3d 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -1472,7 +1472,7 @@ static int stex_biosparam(struct scsi_device *sdev,
 	return 0;
 }
 
-static struct scsi_host_template driver_template = {
+static const struct scsi_host_template driver_template = {
 	.module				= THIS_MODULE,
 	.name				= DRV_NAME,
 	.proc_name			= DRV_NAME,

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

* [PATCH v3 73/80] scsi: sym53c8xx: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (71 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 72/80] scsi: stex: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2023-03-22 19:55 ` [PATCH v3 74/80] scsi: virtio-scsi: " Bart Van Assche
                   ` (8 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Matthew Wilcox, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/sym53c8xx_2/sym_glue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
index 2e2852bd5860..ee36a9c15d9c 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -1224,7 +1224,7 @@ static void sym_free_resources(struct sym_hcb *np, struct pci_dev *pdev,
  *  If all is OK, install interrupt handling and
  *  start the timer daemon.
  */
-static struct Scsi_Host *sym_attach(struct scsi_host_template *tpnt, int unit,
+static struct Scsi_Host *sym_attach(const struct scsi_host_template *tpnt, int unit,
 				    struct sym_device *dev)
 {
 	struct sym_data *sym_data;
@@ -1625,7 +1625,7 @@ static int sym_detach(struct Scsi_Host *shost, struct pci_dev *pdev)
 /*
  * Driver host template.
  */
-static struct scsi_host_template sym2_template = {
+static const struct scsi_host_template sym2_template = {
 	.module			= THIS_MODULE,
 	.name			= "sym53c8xx",
 	.info			= sym53c8xx_info, 

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

* [PATCH v3 74/80] scsi: virtio-scsi: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (72 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 73/80] scsi: sym53c8xx: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2023-03-22 19:55 ` [PATCH v3 75/80] scsi: wd719x: " Bart Van Assche
                   ` (7 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Michael S. Tsirkin, Jason Wang,
	James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/virtio_scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index c5558c45ab3a..58498da9869a 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -746,7 +746,7 @@ static enum scsi_timeout_action virtscsi_eh_timed_out(struct scsi_cmnd *scmnd)
 	return SCSI_EH_RESET_TIMER;
 }
 
-static struct scsi_host_template virtscsi_host_template = {
+static const struct scsi_host_template virtscsi_host_template = {
 	.module = THIS_MODULE,
 	.name = "Virtio SCSI HBA",
 	.proc_name = "virtio_scsi",

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

* [PATCH v3 75/80] scsi: wd719x: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (73 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 74/80] scsi: virtio-scsi: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2023-03-22 19:55 ` [PATCH v3 76/80] scsi: xen-scsifront: " Bart Van Assche
                   ` (6 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/wd719x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/wd719x.c b/drivers/scsi/wd719x.c
index ff1b22077251..5a380eecfc75 100644
--- a/drivers/scsi/wd719x.c
+++ b/drivers/scsi/wd719x.c
@@ -878,7 +878,7 @@ static int wd719x_board_found(struct Scsi_Host *sh)
 	return ret;
 }
 
-static struct scsi_host_template wd719x_template = {
+static const struct scsi_host_template wd719x_template = {
 	.module				= THIS_MODULE,
 	.name				= "Western Digital 719x",
 	.cmd_size			= sizeof(struct wd719x_scb),

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

* [PATCH v3 76/80] scsi: xen-scsifront: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (74 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 75/80] scsi: wd719x: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2023-03-22 19:55 ` [PATCH v3 77/80] scsi: rts5208: " Bart Van Assche
                   ` (5 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Juergen Gross, Stefano Stabellini,
	James E.J. Bottomley

Make it explicit that the SCSI host template is not modified.

Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/xen-scsifront.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c
index 71a3bb83984c..caae61aa2afe 100644
--- a/drivers/scsi/xen-scsifront.c
+++ b/drivers/scsi/xen-scsifront.c
@@ -770,7 +770,7 @@ static void scsifront_sdev_destroy(struct scsi_device *sdev)
 	}
 }
 
-static struct scsi_host_template scsifront_sht = {
+static const struct scsi_host_template scsifront_sht = {
 	.module			= THIS_MODULE,
 	.name			= "Xen SCSI frontend driver",
 	.queuecommand		= scsifront_queuecommand,

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

* [PATCH v3 77/80] scsi: rts5208: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (75 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 76/80] scsi: xen-scsifront: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2023-03-22 19:55 ` [PATCH v3 78/80] scsi: target: tcm-loop: " Bart Van Assche
                   ` (4 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen; +Cc: linux-scsi, Bart Van Assche, Greg Kroah-Hartman

Make it explicit that the SCSI host template is not modified.

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/staging/rts5208/rtsx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
index 2284a96abcff..db2dd0baa8be 100644
--- a/drivers/staging/rts5208/rtsx.c
+++ b/drivers/staging/rts5208/rtsx.c
@@ -191,7 +191,7 @@ static int device_reset(struct scsi_cmnd *srb)
  * this defines our host template, with which we'll allocate hosts
  */
 
-static struct scsi_host_template rtsx_host_template = {
+static const struct scsi_host_template rtsx_host_template = {
 	/* basic userland interface stuff */
 	.name =				CR_DRIVER_NAME,
 	.proc_name =			CR_DRIVER_NAME,

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

* [PATCH v3 78/80] scsi: target: tcm-loop: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (76 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 77/80] scsi: rts5208: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2023-03-22 19:55 ` [PATCH v3 79/80] scsi: ufs: " Bart Van Assche
                   ` (3 subsequent siblings)
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Dmitry Bogdanov, Yang Yingliang,
	Mike Christie

Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/target/loopback/tcm_loop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index 5c8646c2d4e9..5272f7dd85d2 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -298,7 +298,7 @@ static int tcm_loop_target_reset(struct scsi_cmnd *sc)
 	return FAILED;
 }
 
-static struct scsi_host_template tcm_loop_driver_template = {
+static const struct scsi_host_template tcm_loop_driver_template = {
 	.show_info		= tcm_loop_show_info,
 	.proc_name		= "tcm_loopback",
 	.name			= "TCM_Loopback",

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

* [PATCH v3 79/80] scsi: ufs: Declare SCSI host template const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (77 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 78/80] scsi: target: tcm-loop: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2024-01-04  9:52   ` Peter Wang (王信友)
  2023-03-22 19:55 ` [PATCH v3 80/80] usb: uas: Declare two host templates and host template pointers const Bart Van Assche
                   ` (2 subsequent siblings)
  81 siblings, 1 reply; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, James E.J. Bottomley, Bean Huo,
	Avri Altman, Stanley Chu, Asutosh Das

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,

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

* [PATCH v3 80/80] usb: uas: Declare two host templates and host template pointers const
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (78 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 79/80] scsi: ufs: " Bart Van Assche
@ 2023-03-22 19:55 ` Bart Van Assche
  2023-03-25  0:14 ` [PATCH v3 00/80] Constify most SCSI host templates Martin K. Petersen
  2023-04-03  2:15 ` Martin K. Petersen
  81 siblings, 0 replies; 87+ messages in thread
From: Bart Van Assche @ 2023-03-22 19:55 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Alan Stern, Oliver Neukum,
	Greg Kroah-Hartman, linux-usb, Oliver Neukum

Improve source code documentation by constifying host templates that are
not modified.

Acked-by: Alan Stern <stern@rowland.harvard.edu> (for usb-storage)
Acked-by: Oliver Neukum <oneukum@suse.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Oliver Neukum <oneukum@suse.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/usb/image/microtek.c | 2 +-
 drivers/usb/storage/uas.c    | 2 +-
 drivers/usb/storage/usb.c    | 2 +-
 drivers/usb/storage/usb.h    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
index 874ea4b54ced..8c8fa71c69c4 100644
--- a/drivers/usb/image/microtek.c
+++ b/drivers/usb/image/microtek.c
@@ -620,7 +620,7 @@ static int mts_scsi_queuecommand_lck(struct scsi_cmnd *srb)
 
 static DEF_SCSI_QCMD(mts_scsi_queuecommand)
 
-static struct scsi_host_template mts_scsi_host_template = {
+static const struct scsi_host_template mts_scsi_host_template = {
 	.module			= THIS_MODULE,
 	.name			= "microtekX6",
 	.proc_name		= "microtekX6",
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index de3836412bf3..2583ee9815c5 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -894,7 +894,7 @@ static int uas_slave_configure(struct scsi_device *sdev)
 	return 0;
 }
 
-static struct scsi_host_template uas_host_template = {
+static const struct scsi_host_template uas_host_template = {
 	.module = THIS_MODULE,
 	.name = "uas",
 	.queuecommand = uas_queuecommand,
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index ed7c6ad96a74..7b36a3334fb3 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -937,7 +937,7 @@ int usb_stor_probe1(struct us_data **pus,
 		struct usb_interface *intf,
 		const struct usb_device_id *id,
 		const struct us_unusual_dev *unusual_dev,
-		struct scsi_host_template *sht)
+		const struct scsi_host_template *sht)
 {
 	struct Scsi_Host *host;
 	struct us_data *us;
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
index 0451fac1adce..fd3f32670873 100644
--- a/drivers/usb/storage/usb.h
+++ b/drivers/usb/storage/usb.h
@@ -187,7 +187,7 @@ extern int usb_stor_probe1(struct us_data **pus,
 		struct usb_interface *intf,
 		const struct usb_device_id *id,
 		const struct us_unusual_dev *unusual_dev,
-		struct scsi_host_template *sht);
+		const struct scsi_host_template *sht);
 extern int usb_stor_probe2(struct us_data *us);
 extern void usb_stor_disconnect(struct usb_interface *intf);
 

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

* Re: [PATCH v3 30/80] scsi: dc395x: Declare SCSI host template const
  2023-03-22 19:54 ` [PATCH v3 30/80] scsi: dc395x: " Bart Van Assche
@ 2023-03-23  8:43   ` Oliver Neukum
  0 siblings, 0 replies; 87+ messages in thread
From: Oliver Neukum @ 2023-03-23  8:43 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen
  Cc: linux-scsi, Ali Akcaagac, Jamie Lenehan, James E.J. Bottomley

On 22.03.23 20:54, Bart Van Assche wrote:
> Make it explicit that the SCSI host template is not modified.
> 
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Oliver Neukum <oneukum@suse.com>


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

* Re: [PATCH v3 00/80] Constify most SCSI host templates
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (79 preceding siblings ...)
  2023-03-22 19:55 ` [PATCH v3 80/80] usb: uas: Declare two host templates and host template pointers const Bart Van Assche
@ 2023-03-25  0:14 ` Martin K. Petersen
  2023-04-03  2:15 ` Martin K. Petersen
  81 siblings, 0 replies; 87+ messages in thread
From: Martin K. Petersen @ 2023-03-25  0:14 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Martin K . Petersen, linux-scsi


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	Oracle Linux Engineering

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

* Re: [PATCH v3 00/80] Constify most SCSI host templates
  2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
                   ` (80 preceding siblings ...)
  2023-03-25  0:14 ` [PATCH v3 00/80] Constify most SCSI host templates Martin K. Petersen
@ 2023-04-03  2:15 ` Martin K. Petersen
  81 siblings, 0 replies; 87+ messages in thread
From: Martin K. Petersen @ 2023-04-03  2:15 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Martin K . Petersen, linux-scsi

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

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH v3 79/80] scsi: ufs: Declare SCSI host template const
  2023-03-22 19:55 ` [PATCH v3 79/80] scsi: ufs: " Bart Van Assche
@ 2024-01-04  9:52   ` Peter Wang (王信友)
  2024-01-08 17:48     ` Bart Van Assche
  0 siblings, 1 reply; 87+ messages in thread
From: Peter Wang (王信友) @ 2024-01-04  9:52 UTC (permalink / raw)
  To: bvanassche, martin.petersen
  Cc: Alice Chao (趙珮均),
	jejb, beanhuo, avri.altman,
	Chun-Hung Wu (巫駿宏),
	linux-scsi, Powen Kao (高伯文),
	Naomi Chu (朱詠田)

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?

Thanks.
Peter


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

* Re: [PATCH v3 79/80] scsi: ufs: Declare SCSI host template const
  2024-01-04  9:52   ` Peter Wang (王信友)
@ 2024-01-08 17:48     ` Bart Van Assche
  2024-01-09 13:04       ` Peter Wang (王信友)
  0 siblings, 1 reply; 87+ messages in thread
From: Bart Van Assche @ 2024-01-08 17:48 UTC (permalink / raw)
  To: Peter Wang (王信友), martin.petersen
  Cc: Alice Chao (趙珮均),
	jejb, beanhuo, avri.altman,
	Chun-Hung Wu (巫駿宏),
	linux-scsi, Powen Kao (高伯文),
	Naomi Chu (朱詠田)

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.

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

* Re: [PATCH v3 79/80] scsi: ufs: Declare SCSI host template const
  2024-01-08 17:48     ` Bart Van Assche
@ 2024-01-09 13:04       ` Peter Wang (王信友)
  0 siblings, 0 replies; 87+ messages in thread
From: Peter Wang (王信友) @ 2024-01-09 13:04 UTC (permalink / raw)
  To: bvanassche, martin.petersen
  Cc: Alice Chao (趙珮均),
	jejb, beanhuo, avri.altman,
	Chun-Hung Wu (巫駿宏),
	linux-scsi, Naomi Chu (朱詠田),
	Powen Kao (高伯文)

 
> > 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


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

end of thread, other threads:[~2024-01-09 13:04 UTC | newest]

Thread overview: 87+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-22 19:53 [PATCH v3 00/80] Constify most SCSI host templates Bart Van Assche
2023-03-22 19:53 ` [PATCH v3 01/80] scsi: qla2xxx: Refer directly to the qla2xxx_driver_template Bart Van Assche
2023-03-22 19:53 ` [PATCH v3 02/80] scsi: core: Declare most SCSI host template pointers const Bart Van Assche
2023-03-22 19:53 ` [PATCH v3 03/80] scsi: core: Declare SCSI host template pointer members const Bart Van Assche
2023-03-22 19:53 ` [PATCH v3 04/80] ata: Declare SCSI host templates const Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 05/80] firewire: sbp2: Declare the SCSI host template const Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 06/80] RDMA/srp: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 07/80] scsi: message: fusion: Declare SCSI host template members const Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 08/80] scsi: zfcp: Declare SCSI host template const Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 09/80] scsi: 3w-9xxx: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 10/80] scsi: 3w-sas: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 11/80] scsi: 3w-xxxx: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 12/80] scsi: BusLogic: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 13/80] scsi: a100u2w: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 14/80] scsi: a2091: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 15/80] scsi: a3000: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 16/80] scsi: aacraid: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 17/80] scsi: advansys: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 18/80] scsi: aha152x: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 19/80] scsi: aha1542: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 20/80] scsi: aic94xx: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 21/80] scsi: arcmsr: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 22/80] scsi: acornscsi: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 23/80] scsi: arxescsi: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 24/80] scsi: aha1740: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 25/80] scsi: cumana: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 26/80] scsi: eesox: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 27/80] scsi: oak: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 28/80] scsi: powertec: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 29/80] scsi: atp870u: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 30/80] scsi: dc395x: " Bart Van Assche
2023-03-23  8:43   ` Oliver Neukum
2023-03-22 19:54 ` [PATCH v3 31/80] scsi: dmx3191d: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 32/80] scsi: elx: efct: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 33/80] scsi: esas2r: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 34/80] scsi: esp_scsi: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 35/80] scsi: fcoe: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 36/80] scsi: fnic: Declare " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 37/80] scsi: qedf: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 38/80] scsi: fdomain: Declare SCSI " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 39/80] scsi: NCR5380: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 40/80] scsi: gvp11: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 41/80] scsi: hisi_sas: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 42/80] scsi: hpsa: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 43/80] scsi: hptiop: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 44/80] scsi: ibmvfc: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 45/80] scsi: imm: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 46/80] scsi: initio: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 47/80] scsi: ipr: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 48/80] scsi: isci: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 49/80] scsi: iscsi: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 50/80] scsi: mac53c94: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 51/80] scsi: megaraid: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 52/80] scsi: mesh: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 53/80] scsi: mpi3mr: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 54/80] scsi: mpt3sas: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 55/80] scsi: mvme147: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 56/80] scsi: mvsas: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 57/80] scsi: mvumi: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 58/80] scsi: myrb: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 59/80] scsi: myrs: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 60/80] scsi: nsp32: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 61/80] scsi: pcmcia-sym53c500: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 62/80] scsi: pcmcia-pm8001: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 63/80] scsi: pmcraid: " Bart Van Assche
2023-03-22 19:54 ` [PATCH v3 64/80] scsi: ppa: " Bart Van Assche
2023-03-22 19:55 ` [PATCH v3 65/80] scsi: ps3rom: " Bart Van Assche
2023-03-22 19:55 ` [PATCH v3 66/80] scsi: qla1280: " Bart Van Assche
2023-03-22 19:55 ` [PATCH v3 67/80] scsi: qla2xxx: " Bart Van Assche
2023-03-22 19:55 ` [PATCH v3 68/80] scsi: qlogicpti: " Bart Van Assche
2023-03-22 19:55 ` [PATCH v3 69/80] scsi: sgiwd93: " Bart Van Assche
2023-03-22 19:55 ` [PATCH v3 70/80] scsi: smartpqi: " Bart Van Assche
2023-03-22 19:55 ` [PATCH v3 71/80] scsi: snic: " Bart Van Assche
2023-03-22 19:55 ` [PATCH v3 72/80] scsi: stex: " Bart Van Assche
2023-03-22 19:55 ` [PATCH v3 73/80] scsi: sym53c8xx: " Bart Van Assche
2023-03-22 19:55 ` [PATCH v3 74/80] scsi: virtio-scsi: " Bart Van Assche
2023-03-22 19:55 ` [PATCH v3 75/80] scsi: wd719x: " Bart Van Assche
2023-03-22 19:55 ` [PATCH v3 76/80] scsi: xen-scsifront: " Bart Van Assche
2023-03-22 19:55 ` [PATCH v3 77/80] scsi: rts5208: " Bart Van Assche
2023-03-22 19:55 ` [PATCH v3 78/80] scsi: target: tcm-loop: " Bart Van Assche
2023-03-22 19:55 ` [PATCH v3 79/80] scsi: ufs: " Bart Van Assche
2024-01-04  9:52   ` Peter Wang (王信友)
2024-01-08 17:48     ` Bart Van Assche
2024-01-09 13:04       ` Peter Wang (王信友)
2023-03-22 19:55 ` [PATCH v3 80/80] usb: uas: Declare two host templates and host template pointers const Bart Van Assche
2023-03-25  0:14 ` [PATCH v3 00/80] Constify most SCSI host templates Martin K. Petersen
2023-04-03  2:15 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).