All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/81] Constify most SCSI host templates
@ 2023-03-04  0:29 Bart Van Assche
  2023-03-04  0:29 ` [PATCH 01/81] scsi: qla2xxx: Refer directly to the qla2xxx_driver_template Bart Van Assche
                   ` (80 more replies)
  0 siblings, 81 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:29 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.

Bart Van Assche (81):
  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: iscsi: Declare SCSI host template const
  scsi: mac53c94: Declare SCSI host template const
  scsi: mac_scsi: 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
  scsi: core: Update a source code comment

 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_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_bk3710.c                 | 380 ++++++++++++++++++++++
 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_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/mac_scsi.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         |   4 +-
 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                  |   6 +-
 224 files changed, 648 insertions(+), 269 deletions(-)
 create mode 100644 drivers/ata/pata_bk3710.c


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

* [PATCH 01/81] scsi: qla2xxx: Refer directly to the qla2xxx_driver_template
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
@ 2023-03-04  0:29 ` Bart Van Assche
  2023-03-06 13:10   ` John Garry
  2023-03-04  0:29 ` [PATCH 02/81] scsi: core: Declare most SCSI host template pointers const Bart Van Assche
                   ` (79 subsequent siblings)
  80 siblings, 1 reply; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:29 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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index aa0cf5ca6c1c..8d9a6aa3ea61 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -6395,8 +6395,8 @@ 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;
+	if (!(qla2xxx_driver_template.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] 116+ messages in thread

* [PATCH 02/81] scsi: core: Declare most SCSI host template pointers const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
  2023-03-04  0:29 ` [PATCH 01/81] scsi: qla2xxx: Refer directly to the qla2xxx_driver_template Bart Van Assche
@ 2023-03-04  0:29 ` Bart Van Assche
  2023-03-06 10:40   ` Benjamin Block
                     ` (2 more replies)
  2023-03-04  0:29 ` [PATCH 03/81] scsi: core: Declare SCSI host template pointer members const Bart Van Assche
                   ` (78 subsequent siblings)
  80 siblings, 3 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:29 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Christoph Hellwig, Ming Lei,
	Hannes Reinecke, John Garry, 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.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: John Garry <john.garry@huawei.com>
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] 116+ messages in thread

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

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

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

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] 116+ messages in thread

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

Make it explicit that ATA host templates are not modified.

Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: John Garry <john.garry@huawei.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_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_bk3710.c       | 380 ++++++++++++++++++++++++++++++++
 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_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 +-
 110 files changed, 507 insertions(+), 127 deletions(-)
 create mode 100644 drivers/ata/pata_bk3710.c

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_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_bk3710.c b/drivers/ata/pata_bk3710.c
new file mode 100644
index 000000000000..6cadb8741a43
--- /dev/null
+++ b/drivers/ata/pata_bk3710.c
@@ -0,0 +1,380 @@
+// SPDX-License-Identifier: GPL-2.0
+
+/*
+ * Palmchip BK3710 PATA controller driver
+ *
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ *
+ * Based on palm_bk3710.c:
+ *
+ * Copyright (C) 2006 Texas Instruments.
+ * Copyright (C) 2007 MontaVista Software, Inc., <source@mvista.com>
+ */
+
+#include <linux/ata.h>
+#include <linux/clk.h>
+#include <linux/delay.h>
+#include <linux/init.h>
+#include <linux/ioport.h>
+#include <linux/kernel.h>
+#include <linux/libata.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/types.h>
+
+#define DRV_NAME "pata_bk3710"
+
+#define BK3710_TF_OFFSET	0x1F0
+#define BK3710_CTL_OFFSET	0x3F6
+
+#define BK3710_BMISP		0x02
+#define BK3710_IDETIMP		0x40
+#define BK3710_UDMACTL		0x48
+#define BK3710_MISCCTL		0x50
+#define BK3710_REGSTB		0x54
+#define BK3710_REGRCVR		0x58
+#define BK3710_DATSTB		0x5C
+#define BK3710_DATRCVR		0x60
+#define BK3710_DMASTB		0x64
+#define BK3710_DMARCVR		0x68
+#define BK3710_UDMASTB		0x6C
+#define BK3710_UDMATRP		0x70
+#define BK3710_UDMAENV		0x74
+#define BK3710_IORDYTMP		0x78
+
+static const struct scsi_host_template pata_bk3710_sht = {
+	ATA_BMDMA_SHT(DRV_NAME),
+};
+
+static unsigned int ideclk_period; /* in nanoseconds */
+
+struct pata_bk3710_udmatiming {
+	unsigned int rptime;	/* tRP -- Ready to pause time (nsec) */
+	unsigned int cycletime;	/* tCYCTYP2/2 -- avg Cycle Time (nsec) */
+				/* tENV is always a minimum of 20 nsec */
+};
+
+static const struct pata_bk3710_udmatiming pata_bk3710_udmatimings[6] = {
+	{ 160, 240 / 2 },	/* UDMA Mode 0 */
+	{ 125, 160 / 2 },	/* UDMA Mode 1 */
+	{ 100, 120 / 2 },	/* UDMA Mode 2 */
+	{ 100,  90 / 2 },	/* UDMA Mode 3 */
+	{ 100,  60 / 2 },	/* UDMA Mode 4 */
+	{  85,  40 / 2 },	/* UDMA Mode 5 */
+};
+
+static void pata_bk3710_setudmamode(void __iomem *base, unsigned int dev,
+				    unsigned int mode)
+{
+	u32 val32;
+	u16 val16;
+	u8 tenv, trp, t0;
+
+	/* DMA Data Setup */
+	t0 = DIV_ROUND_UP(pata_bk3710_udmatimings[mode].cycletime,
+			  ideclk_period) - 1;
+	tenv = DIV_ROUND_UP(20, ideclk_period) - 1;
+	trp = DIV_ROUND_UP(pata_bk3710_udmatimings[mode].rptime,
+			   ideclk_period) - 1;
+
+	/* udmastb Ultra DMA Access Strobe Width */
+	val32 = ioread32(base + BK3710_UDMASTB) & (0xFF << (dev ? 0 : 8));
+	val32 |= t0 << (dev ? 8 : 0);
+	iowrite32(val32, base + BK3710_UDMASTB);
+
+	/* udmatrp Ultra DMA Ready to Pause Time */
+	val32 = ioread32(base + BK3710_UDMATRP) & (0xFF << (dev ? 0 : 8));
+	val32 |= trp << (dev ? 8 : 0);
+	iowrite32(val32, base + BK3710_UDMATRP);
+
+	/* udmaenv Ultra DMA envelop Time */
+	val32 = ioread32(base + BK3710_UDMAENV) & (0xFF << (dev ? 0 : 8));
+	val32 |= tenv << (dev ? 8 : 0);
+	iowrite32(val32, base + BK3710_UDMAENV);
+
+	/* Enable UDMA for Device */
+	val16 = ioread16(base + BK3710_UDMACTL) | (1 << dev);
+	iowrite16(val16, base + BK3710_UDMACTL);
+}
+
+static void pata_bk3710_setmwdmamode(void __iomem *base, unsigned int dev,
+				     unsigned short min_cycle,
+				     unsigned int mode)
+{
+	const struct ata_timing *t;
+	int cycletime;
+	u32 val32;
+	u16 val16;
+	u8 td, tkw, t0;
+
+	t = ata_timing_find_mode(mode);
+	cycletime = max_t(int, t->cycle, min_cycle);
+
+	/* DMA Data Setup */
+	t0 = DIV_ROUND_UP(cycletime, ideclk_period);
+	td = DIV_ROUND_UP(t->active, ideclk_period);
+	tkw = t0 - td - 1;
+	td--;
+
+	val32 = ioread32(base + BK3710_DMASTB) & (0xFF << (dev ? 0 : 8));
+	val32 |= td << (dev ? 8 : 0);
+	iowrite32(val32, base + BK3710_DMASTB);
+
+	val32 = ioread32(base + BK3710_DMARCVR) & (0xFF << (dev ? 0 : 8));
+	val32 |= tkw << (dev ? 8 : 0);
+	iowrite32(val32, base + BK3710_DMARCVR);
+
+	/* Disable UDMA for Device */
+	val16 = ioread16(base + BK3710_UDMACTL) & ~(1 << dev);
+	iowrite16(val16, base + BK3710_UDMACTL);
+}
+
+static void pata_bk3710_set_dmamode(struct ata_port *ap,
+				    struct ata_device *adev)
+{
+	void __iomem *base = (void __iomem *)ap->ioaddr.bmdma_addr;
+	int is_slave = adev->devno;
+	const u8 xferspeed = adev->dma_mode;
+
+	if (xferspeed >= XFER_UDMA_0)
+		pata_bk3710_setudmamode(base, is_slave,
+					xferspeed - XFER_UDMA_0);
+	else
+		pata_bk3710_setmwdmamode(base, is_slave,
+					 adev->id[ATA_ID_EIDE_DMA_MIN],
+					 xferspeed);
+}
+
+static void pata_bk3710_setpiomode(void __iomem *base, struct ata_device *pair,
+				   unsigned int dev, unsigned int cycletime,
+				   unsigned int mode)
+{
+	const struct ata_timing *t;
+	u32 val32;
+	u8 t2, t2i, t0;
+
+	t = ata_timing_find_mode(XFER_PIO_0 + mode);
+
+	/* PIO Data Setup */
+	t0 = DIV_ROUND_UP(cycletime, ideclk_period);
+	t2 = DIV_ROUND_UP(t->active, ideclk_period);
+
+	t2i = t0 - t2 - 1;
+	t2--;
+
+	val32 = ioread32(base + BK3710_DATSTB) & (0xFF << (dev ? 0 : 8));
+	val32 |= t2 << (dev ? 8 : 0);
+	iowrite32(val32, base + BK3710_DATSTB);
+
+	val32 = ioread32(base + BK3710_DATRCVR) & (0xFF << (dev ? 0 : 8));
+	val32 |= t2i << (dev ? 8 : 0);
+	iowrite32(val32, base + BK3710_DATRCVR);
+
+	/* FIXME: this is broken also in the old driver */
+	if (pair) {
+		u8 mode2 = pair->pio_mode - XFER_PIO_0;
+
+		if (mode2 < mode)
+			mode = mode2;
+	}
+
+	/* TASKFILE Setup */
+	t0 = DIV_ROUND_UP(t->cyc8b, ideclk_period);
+	t2 = DIV_ROUND_UP(t->act8b, ideclk_period);
+
+	t2i = t0 - t2 - 1;
+	t2--;
+
+	val32 = ioread32(base + BK3710_REGSTB) & (0xFF << (dev ? 0 : 8));
+	val32 |= t2 << (dev ? 8 : 0);
+	iowrite32(val32, base + BK3710_REGSTB);
+
+	val32 = ioread32(base + BK3710_REGRCVR) & (0xFF << (dev ? 0 : 8));
+	val32 |= t2i << (dev ? 8 : 0);
+	iowrite32(val32, base + BK3710_REGRCVR);
+}
+
+static void pata_bk3710_set_piomode(struct ata_port *ap,
+				    struct ata_device *adev)
+{
+	void __iomem *base = (void __iomem *)ap->ioaddr.bmdma_addr;
+	struct ata_device *pair = ata_dev_pair(adev);
+	const struct ata_timing *t = ata_timing_find_mode(adev->pio_mode);
+	const u16 *id = adev->id;
+	unsigned int cycle_time = 0;
+	int is_slave = adev->devno;
+	const u8 pio = adev->pio_mode - XFER_PIO_0;
+
+	if (id[ATA_ID_FIELD_VALID] & 2) {
+		if (ata_id_has_iordy(id))
+			cycle_time = id[ATA_ID_EIDE_PIO_IORDY];
+		else
+			cycle_time = id[ATA_ID_EIDE_PIO];
+
+		/* conservative "downgrade" for all pre-ATA2 drives */
+		if (pio < 3 && cycle_time < t->cycle)
+			cycle_time = 0; /* use standard timing */
+	}
+
+	if (!cycle_time)
+		cycle_time = t->cycle;
+
+	pata_bk3710_setpiomode(base, pair, is_slave, cycle_time, pio);
+}
+
+static void pata_bk3710_chipinit(void __iomem *base)
+{
+	/*
+	 * REVISIT:  the ATA reset signal needs to be managed through a
+	 * GPIO, which means it should come from platform_data.  Until
+	 * we get and use such information, we have to trust that things
+	 * have been reset before we get here.
+	 */
+
+	/*
+	 * Program the IDETIMP Register Value based on the following assumptions
+	 *
+	 * (ATA_IDETIMP_IDEEN		, ENABLE ) |
+	 * (ATA_IDETIMP_PREPOST1	, DISABLE) |
+	 * (ATA_IDETIMP_PREPOST0	, DISABLE) |
+	 *
+	 * DM6446 silicon rev 2.1 and earlier have no observed net benefit
+	 * from enabling prefetch/postwrite.
+	 */
+	iowrite16(BIT(15), base + BK3710_IDETIMP);
+
+	/*
+	 * UDMACTL Ultra-ATA DMA Control
+	 * (ATA_UDMACTL_UDMAP1	, 0 ) |
+	 * (ATA_UDMACTL_UDMAP0	, 0 )
+	 *
+	 */
+	iowrite16(0, base + BK3710_UDMACTL);
+
+	/*
+	 * MISCCTL Miscellaneous Conrol Register
+	 * (ATA_MISCCTL_HWNHLD1P	, 1 cycle)
+	 * (ATA_MISCCTL_HWNHLD0P	, 1 cycle)
+	 * (ATA_MISCCTL_TIMORIDE	, 1)
+	 */
+	iowrite32(0x001, base + BK3710_MISCCTL);
+
+	/*
+	 * IORDYTMP IORDY Timer for Primary Register
+	 * (ATA_IORDYTMP_IORDYTMP	, DISABLE)
+	 */
+	iowrite32(0, base + BK3710_IORDYTMP);
+
+	/*
+	 * Configure BMISP Register
+	 * (ATA_BMISP_DMAEN1	, DISABLE )	|
+	 * (ATA_BMISP_DMAEN0	, DISABLE )	|
+	 * (ATA_BMISP_IORDYINT	, CLEAR)	|
+	 * (ATA_BMISP_INTRSTAT	, CLEAR)	|
+	 * (ATA_BMISP_DMAERROR	, CLEAR)
+	 */
+	iowrite16(0xE, base + BK3710_BMISP);
+
+	pata_bk3710_setpiomode(base, NULL, 0, 600, 0);
+	pata_bk3710_setpiomode(base, NULL, 1, 600, 0);
+}
+
+static struct ata_port_operations pata_bk3710_ports_ops = {
+	.inherits		= &ata_bmdma_port_ops,
+	.cable_detect		= ata_cable_80wire,
+
+	.set_piomode		= pata_bk3710_set_piomode,
+	.set_dmamode		= pata_bk3710_set_dmamode,
+};
+
+static int __init pata_bk3710_probe(struct platform_device *pdev)
+{
+	struct clk *clk;
+	struct resource *mem;
+	struct ata_host *host;
+	struct ata_port *ap;
+	void __iomem *base;
+	unsigned long rate;
+	int irq;
+
+	clk = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(clk))
+		return -ENODEV;
+
+	clk_enable(clk);
+	rate = clk_get_rate(clk);
+	if (!rate)
+		return -EINVAL;
+
+	/* NOTE:  round *down* to meet minimum timings; we count in clocks */
+	ideclk_period = 1000000000UL / rate;
+
+	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0) {
+		pr_err(DRV_NAME ": failed to get IRQ resource\n");
+		return irq;
+	}
+
+	base = devm_ioremap_resource(&pdev->dev, mem);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
+
+	/* configure the Palmchip controller */
+	pata_bk3710_chipinit(base);
+
+	/* allocate host */
+	host = ata_host_alloc(&pdev->dev, 1);
+	if (!host)
+		return -ENOMEM;
+	ap = host->ports[0];
+
+	ap->ops = &pata_bk3710_ports_ops;
+	ap->pio_mask = ATA_PIO4;
+	ap->mwdma_mask = ATA_MWDMA2;
+	ap->udma_mask = rate < 100000000 ? ATA_UDMA4 : ATA_UDMA5;
+	ap->flags |= ATA_FLAG_SLAVE_POSS;
+
+	ap->ioaddr.data_addr		= base + BK3710_TF_OFFSET;
+	ap->ioaddr.error_addr		= base + BK3710_TF_OFFSET + 1;
+	ap->ioaddr.feature_addr		= base + BK3710_TF_OFFSET + 1;
+	ap->ioaddr.nsect_addr		= base + BK3710_TF_OFFSET + 2;
+	ap->ioaddr.lbal_addr		= base + BK3710_TF_OFFSET + 3;
+	ap->ioaddr.lbam_addr		= base + BK3710_TF_OFFSET + 4;
+	ap->ioaddr.lbah_addr		= base + BK3710_TF_OFFSET + 5;
+	ap->ioaddr.device_addr		= base + BK3710_TF_OFFSET + 6;
+	ap->ioaddr.status_addr		= base + BK3710_TF_OFFSET + 7;
+	ap->ioaddr.command_addr		= base + BK3710_TF_OFFSET + 7;
+
+	ap->ioaddr.altstatus_addr	= base + BK3710_CTL_OFFSET;
+	ap->ioaddr.ctl_addr		= base + BK3710_CTL_OFFSET;
+
+	ap->ioaddr.bmdma_addr		= base;
+
+	ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx",
+		      (unsigned long)base + BK3710_TF_OFFSET,
+		      (unsigned long)base + BK3710_CTL_OFFSET);
+
+	/* activate */
+	return ata_host_activate(host, irq, ata_sff_interrupt, 0,
+				 &pata_bk3710_sht);
+}
+
+/* work with hotplug and coldplug */
+MODULE_ALIAS("platform:palm_bk3710");
+
+static struct platform_driver pata_bk3710_driver = {
+	.driver = {
+		.name = "palm_bk3710",
+	},
+};
+
+static int __init pata_bk3710_init(void)
+{
+	return platform_driver_probe(&pata_bk3710_driver, pata_bk3710_probe);
+}
+
+module_init(pata_bk3710_init);
+MODULE_LICENSE("GPL v2");
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_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] 116+ messages in thread

* [PATCH 05/81] firewire: sbp2: Declare the SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (3 preceding siblings ...)
  2023-03-04  0:29 ` [PATCH 04/81] ata: Declare SCSI host templates const Bart Van Assche
@ 2023-03-04  0:29 ` Bart Van Assche
  2023-03-04  0:29 ` [PATCH 06/81] RDMA/srp: " Bart Van Assche
                   ` (75 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:29 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] 116+ messages in thread

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

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

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] 116+ messages in thread

* [PATCH 07/81] scsi: message: fusion: Declare SCSI host template members const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (5 preceding siblings ...)
  2023-03-04  0:29 ` [PATCH 06/81] RDMA/srp: " Bart Van Assche
@ 2023-03-04  0:29 ` Bart Van Assche
  2023-03-04  0:29 ` [PATCH 08/81] scsi: zfcp: Declare SCSI host template const Bart Van Assche
                   ` (73 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:29 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] 116+ messages in thread

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

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

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] 116+ messages in thread

* [PATCH 09/81] scsi: 3w-9xxx: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (7 preceding siblings ...)
  2023-03-04  0:29 ` [PATCH 08/81] scsi: zfcp: Declare SCSI host template const Bart Van Assche
@ 2023-03-04  0:29 ` Bart Van Assche
  2023-03-04  0:29 ` [PATCH 10/81] scsi: 3w-sas: " Bart Van Assche
                   ` (71 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:29 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] 116+ messages in thread

* [PATCH 10/81] scsi: 3w-sas: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (8 preceding siblings ...)
  2023-03-04  0:29 ` [PATCH 09/81] scsi: 3w-9xxx: " Bart Van Assche
@ 2023-03-04  0:29 ` Bart Van Assche
  2023-03-04  0:29 ` [PATCH 11/81] scsi: 3w-xxxx: " Bart Van Assche
                   ` (70 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:29 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] 116+ messages in thread

* [PATCH 11/81] scsi: 3w-xxxx: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (9 preceding siblings ...)
  2023-03-04  0:29 ` [PATCH 10/81] scsi: 3w-sas: " Bart Van Assche
@ 2023-03-04  0:29 ` Bart Van Assche
  2023-03-04  0:29 ` [PATCH 12/81] scsi: BusLogic: " Bart Van Assche
                   ` (69 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:29 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] 116+ messages in thread

* [PATCH 12/81] scsi: BusLogic: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (10 preceding siblings ...)
  2023-03-04  0:29 ` [PATCH 11/81] scsi: 3w-xxxx: " Bart Van Assche
@ 2023-03-04  0:29 ` Bart Van Assche
  2023-03-06 23:42   ` Khalid Aziz
  2023-03-04  0:29 ` [PATCH 13/81] scsi: a100u2w: " Bart Van Assche
                   ` (68 subsequent siblings)
  80 siblings, 1 reply; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:29 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.

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] 116+ messages in thread

* [PATCH 13/81] scsi: a100u2w: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (11 preceding siblings ...)
  2023-03-04  0:29 ` [PATCH 12/81] scsi: BusLogic: " Bart Van Assche
@ 2023-03-04  0:29 ` Bart Van Assche
  2023-03-04  0:29 ` [PATCH 14/81] scsi: a2091: " Bart Van Assche
                   ` (67 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:29 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] 116+ messages in thread

* [PATCH 14/81] scsi: a2091: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (12 preceding siblings ...)
  2023-03-04  0:29 ` [PATCH 13/81] scsi: a100u2w: " Bart Van Assche
@ 2023-03-04  0:29 ` Bart Van Assche
  2023-03-04  0:29 ` [PATCH 15/81] scsi: a3000: " Bart Van Assche
                   ` (66 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:29 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] 116+ messages in thread

* [PATCH 15/81] scsi: a3000: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (13 preceding siblings ...)
  2023-03-04  0:29 ` [PATCH 14/81] scsi: a2091: " Bart Van Assche
@ 2023-03-04  0:29 ` Bart Van Assche
  2023-03-04  0:29 ` [PATCH 16/81] scsi: aacraid: " Bart Van Assche
                   ` (65 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:29 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] 116+ messages in thread

* [PATCH 16/81] scsi: aacraid: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (14 preceding siblings ...)
  2023-03-04  0:29 ` [PATCH 15/81] scsi: a3000: " Bart Van Assche
@ 2023-03-04  0:29 ` Bart Van Assche
  2023-03-04  0:29 ` [PATCH 17/81] scsi: advansys: " Bart Van Assche
                   ` (64 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:29 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 5ba5c18b77b4..d0c1f024592c 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -1476,7 +1476,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] 116+ messages in thread

* [PATCH 17/81] scsi: advansys: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (15 preceding siblings ...)
  2023-03-04  0:29 ` [PATCH 16/81] scsi: aacraid: " Bart Van Assche
@ 2023-03-04  0:29 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 18/81] scsi: aha152x: " Bart Van Assche
                   ` (63 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:29 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] 116+ messages in thread

* [PATCH 18/81] scsi: aha152x: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (16 preceding siblings ...)
  2023-03-04  0:29 ` [PATCH 17/81] scsi: advansys: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 19/81] scsi: aha1542: " Bart Van Assche
                   ` (62 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 19/81] scsi: aha1542: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (17 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 18/81] scsi: aha152x: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 20/81] scsi: aic94xx: " Bart Van Assche
                   ` (61 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 20/81] scsi: aic94xx: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (18 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 19/81] scsi: aha1542: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 21/81] scsi: arcmsr: " Bart Van Assche
                   ` (60 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 21/81] scsi: arcmsr: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (19 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 20/81] scsi: aic94xx: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 22/81] scsi: acornscsi: " Bart Van Assche
                   ` (59 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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/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 d3fb8a9c1c39..32bc77200eaa 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -152,7 +152,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] 116+ messages in thread

* [PATCH 22/81] scsi: acornscsi: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (20 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 21/81] scsi: arcmsr: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 23/81] scsi: arxescsi: " Bart Van Assche
                   ` (58 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 23/81] scsi: arxescsi: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (21 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 22/81] scsi: acornscsi: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 24/81] scsi: aha1740: " Bart Van Assche
                   ` (57 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 24/81] scsi: aha1740: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (22 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 23/81] scsi: arxescsi: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 25/81] scsi: cumana: " Bart Van Assche
                   ` (56 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 25/81] scsi: cumana: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (23 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 24/81] scsi: aha1740: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 26/81] scsi: eesox: " Bart Van Assche
                   ` (55 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 26/81] scsi: eesox: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (24 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 25/81] scsi: cumana: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 27/81] scsi: oak: " Bart Van Assche
                   ` (54 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 27/81] scsi: oak: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (25 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 26/81] scsi: eesox: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 28/81] scsi: powertec: " Bart Van Assche
                   ` (53 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 28/81] scsi: powertec: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (26 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 27/81] scsi: oak: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 29/81] scsi: atp870u: " Bart Van Assche
                   ` (52 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 29/81] scsi: atp870u: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (27 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 28/81] scsi: powertec: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 30/81] scsi: dc395x: " Bart Van Assche
                   ` (51 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 30/81] scsi: dc395x: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (28 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 29/81] scsi: atp870u: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 31/81] scsi: dmx3191d: " Bart Van Assche
                   ` (50 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 31/81] scsi: dmx3191d: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (29 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 30/81] scsi: dc395x: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 32/81] scsi: elx: efct: " Bart Van Assche
                   ` (49 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 32/81] scsi: elx: efct: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (30 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 31/81] scsi: dmx3191d: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 33/81] scsi: esas2r: " Bart Van Assche
                   ` (48 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 33/81] scsi: esas2r: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (31 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 32/81] scsi: elx: efct: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 34/81] scsi: esp_scsi: " Bart Van Assche
                   ` (47 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 34/81] scsi: esp_scsi: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (32 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 33/81] scsi: esas2r: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 35/81] scsi: fcoe: " Bart Van Assche
                   ` (46 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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 5dc38d35745b..fb0611bfb209 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] 116+ messages in thread

* [PATCH 35/81] scsi: fcoe: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (33 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 34/81] scsi: esp_scsi: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 36/81] scsi: fnic: Declare " Bart Van Assche
                   ` (45 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 36/81] scsi: fnic: Declare host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (34 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 35/81] scsi: fcoe: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 37/81] scsi: qedf: " Bart Van Assche
                   ` (44 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 37/81] scsi: qedf: Declare host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (35 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 36/81] scsi: fnic: Declare " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 38/81] scsi: fdomain: Declare SCSI " Bart Van Assche
                   ` (43 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 38/81] scsi: fdomain: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (36 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 37/81] scsi: qedf: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 39/81] scsi: NCR5380: " Bart Van Assche
                   ` (42 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 39/81] scsi: NCR5380: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (37 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 38/81] scsi: fdomain: Declare SCSI " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 40/81] scsi: gvp11: " Bart Van Assche
                   ` (41 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 40/81] scsi: gvp11: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (38 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 39/81] scsi: NCR5380: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 41/81] scsi: hisi_sas: " Bart Van Assche
                   ` (40 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 41/81] scsi: hisi_sas: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (39 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 40/81] scsi: gvp11: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-06  1:59   ` chenxiang (M)
  2023-03-04  0:30 ` [PATCH 42/81] scsi: hpsa: " Bart Van Assche
                   ` (39 subsequent siblings)
  80 siblings, 1 reply; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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.

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 6f8a52a1b808..6ba59ab8c1db 100644
--- a/drivers/scsi/hisi_sas/hisi_sas.h
+++ b/drivers/scsi/hisi_sas/hisi_sas.h
@@ -344,7 +344,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 0c3fcb807806..d65ba65b6dac 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
@@ -3216,7 +3216,7 @@ static void hisi_sas_map_queues(struct Scsi_Host *shost)
 	blk_mq_pci_map_queues(qmap, hisi_hba->pci_dev, BASE_VECTORS_V3_HW);
 }
 
-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] 116+ messages in thread

* [PATCH 42/81] scsi: hpsa: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (40 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 41/81] scsi: hisi_sas: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 43/81] scsi: hptiop: " Bart Van Assche
                   ` (38 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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 f6da34850af9..ff8436fe6dd1 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] 116+ messages in thread

* [PATCH 43/81] scsi: hptiop: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (41 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 42/81] scsi: hpsa: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 44/81] scsi: ibmvfc: " Bart Van Assche
                   ` (37 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 44/81] scsi: ibmvfc: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (42 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 43/81] scsi: hptiop: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  1:02   ` Tyrel Datwyler
  2023-03-04  0:30 ` [PATCH 45/81] scsi: imm: " Bart Van Assche
                   ` (36 subsequent siblings)
  80 siblings, 1 reply; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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.

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] 116+ messages in thread

* [PATCH 45/81] scsi: imm: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (43 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 44/81] scsi: ibmvfc: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 46/81] scsi: initio: " Bart Van Assche
                   ` (35 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 46/81] scsi: initio: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (44 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 45/81] scsi: imm: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 47/81] scsi: ipr: " Bart Van Assche
                   ` (34 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 47/81] scsi: ipr: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (45 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 46/81] scsi: initio: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-09 18:53   ` Brian King
  2023-03-04  0:30 ` [PATCH 48/81] scsi: iscsi: " Bart Van Assche
                   ` (33 subsequent siblings)
  80 siblings, 1 reply; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Brian 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/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] 116+ messages in thread

* [PATCH 48/81] scsi: iscsi: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (46 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 47/81] scsi: ipr: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-06 17:20   ` Mike Christie
  2023-03-04  0:30 ` [PATCH 49/81] scsi: mac53c94: " Bart Van Assche
                   ` (32 subsequent siblings)
  80 siblings, 1 reply; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Sagi Grimberg, Max Gurtovoy,
	Jason Gunthorpe, Leon Romanovsky, Ketan Mukadam,
	James E.J. Bottomley, Nilesh Javali, Manish Rangankar,
	GR-QLogic-Storage-Upstream, Varun Prakash, Artur Paszkiewicz,
	Lee Duncan, Chris Leech, Mike Christie, Jesper Juhl

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

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/isci/init.c                 | 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 +-
 12 files changed, 15 insertions(+), 15 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 50a577ac3bb4..5d416507947b 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/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,
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] 116+ messages in thread

* [PATCH 49/81] scsi: mac53c94: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (47 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 48/81] scsi: iscsi: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 50/81] scsi: mac_scsi: " Bart Van Assche
                   ` (31 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 50/81] scsi: mac_scsi: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (48 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 49/81] scsi: mac53c94: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 51/81] scsi: megaraid: " Bart Van Assche
                   ` (30 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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/mac_scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
index 2e511697fce3..1d13f1ebc094 100644
--- a/drivers/scsi/mac_scsi.c
+++ b/drivers/scsi/mac_scsi.c
@@ -422,7 +422,7 @@ static int macscsi_dma_residual(struct NCR5380_hostdata *hostdata)
 #define DRV_MODULE_NAME         "mac_scsi"
 #define PFX                     DRV_MODULE_NAME ": "
 
-static struct scsi_host_template mac_scsi_template = {
+struct scsi_host_template mac_scsi_template = {
 	.module			= THIS_MODULE,
 	.proc_name		= DRV_MODULE_NAME,
 	.name			= "Macintosh NCR5380 SCSI",

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

* [PATCH 51/81] scsi: megaraid: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (49 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 50/81] scsi: mac_scsi: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 52/81] scsi: mesh: " Bart Van Assche
                   ` (29 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 52/81] scsi: mesh: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (50 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 51/81] scsi: megaraid: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 53/81] scsi: mpi3mr: " Bart Van Assche
                   ` (28 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 53/81] scsi: mpi3mr: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (51 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 52/81] scsi: mesh: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 54/81] scsi: mpt3sas: " Bart Van Assche
                   ` (27 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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 6eaeba41072c..207a607d8997 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -4757,7 +4757,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] 116+ messages in thread

* [PATCH 54/81] scsi: mpt3sas: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (52 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 53/81] scsi: mpi3mr: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 55/81] scsi: mvme147: " Bart Van Assche
                   ` (26 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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 8e24ebcebfe5..7e4a97c61873 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c
@@ -11926,7 +11926,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,
@@ -11964,7 +11964,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] 116+ messages in thread

* [PATCH 55/81] scsi: mvme147: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (53 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 54/81] scsi: mpt3sas: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 56/81] scsi: mvsas: " Bart Van Assche
                   ` (25 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

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

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

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] 116+ messages in thread

* [PATCH 57/81] scsi: mvumi: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (55 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 56/81] scsi: mvsas: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 58/81] scsi: myrb: " Bart Van Assche
                   ` (23 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 58/81] scsi: myrb: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (56 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 57/81] scsi: mvumi: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 59/81] scsi: myrs: " Bart Van Assche
                   ` (22 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 59/81] scsi: myrs: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (57 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 58/81] scsi: myrb: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 60/81] scsi: nsp32: " Bart Van Assche
                   ` (21 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 60/81] scsi: nsp32: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (58 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 59/81] scsi: myrs: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 61/81] scsi: pcmcia-sym53c500: " Bart Van Assche
                   ` (20 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 61/81] scsi: pcmcia-sym53c500: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (59 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 60/81] scsi: nsp32: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 62/81] scsi: pcmcia-pm8001: " Bart Van Assche
                   ` (19 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 62/81] scsi: pcmcia-pm8001: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (60 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 61/81] scsi: pcmcia-sym53c500: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 63/81] scsi: pmcraid: " Bart Van Assche
                   ` (18 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Jack 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/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] 116+ messages in thread

* [PATCH 63/81] scsi: pmcraid: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (61 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 62/81] scsi: pcmcia-pm8001: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 64/81] scsi: ppa: " Bart Van Assche
                   ` (17 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 64/81] scsi: ppa: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (62 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 63/81] scsi: pmcraid: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 65/81] scsi: ps3rom: " Bart Van Assche
                   ` (16 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 65/81] scsi: ps3rom: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (63 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 64/81] scsi: ppa: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:53   ` Geoff Levand
  2023-03-04 19:44   ` Geoff Levand
  2023-03-04  0:30 ` [PATCH 66/81] scsi: qla1280: " Bart Van Assche
                   ` (15 subsequent siblings)
  80 siblings, 2 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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.

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] 116+ messages in thread

* [PATCH 66/81] scsi: qla1280: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (64 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 65/81] scsi: ps3rom: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 67/81] scsi: qla2xxx: " Bart Van Assche
                   ` (14 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 67/81] scsi: qla2xxx: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (65 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 66/81] scsi: qla1280: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 68/81] scsi: qlogicpti: " Bart Van Assche
                   ` (13 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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 545167627e48..08e7873abb3d 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -5004,8 +5004,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] 116+ messages in thread

* [PATCH 68/81] scsi: qlogicpti: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (66 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 67/81] scsi: qla2xxx: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 69/81] scsi: sgiwd93: " Bart Van Assche
                   ` (12 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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 8c961ff03fcd..6fa8c78c3116 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] 116+ messages in thread

* [PATCH 69/81] scsi: sgiwd93: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (67 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 68/81] scsi: qlogicpti: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 70/81] scsi: smartpqi: " Bart Van Assche
                   ` (11 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 70/81] scsi: smartpqi: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (68 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 69/81] scsi: sgiwd93: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 71/81] scsi: snic: " Bart Van Assche
                   ` (10 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 71/81] scsi: snic: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (69 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 70/81] scsi: smartpqi: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 72/81] scsi: stex: " Bart Van Assche
                   ` (9 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 72/81] scsi: stex: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (70 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 71/81] scsi: snic: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 73/81] scsi: sym53c8xx: " Bart Van Assche
                   ` (8 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 73/81] scsi: sym53c8xx: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (71 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 72/81] scsi: stex: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 74/81] scsi: virtio-scsi: " Bart Van Assche
                   ` (7 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 74/81] scsi: virtio-scsi: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (72 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 73/81] scsi: sym53c8xx: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 75/81] scsi: wd719x: " Bart Van Assche
                   ` (6 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 75/81] scsi: wd719x: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (73 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 74/81] scsi: virtio-scsi: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-04  0:30 ` [PATCH 76/81] scsi: xen-scsifront: " Bart Van Assche
                   ` (5 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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] 116+ messages in thread

* [PATCH 76/81] scsi: xen-scsifront: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (74 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 75/81] scsi: wd719x: " Bart Van Assche
@ 2023-03-04  0:30 ` Bart Van Assche
  2023-03-06  7:41   ` Juergen Gross
  2023-03-04  0:30 ` [PATCH 77/81] scsi: rts5208: " Bart Van Assche
                   ` (4 subsequent siblings)
  80 siblings, 1 reply; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:30 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.

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] 116+ messages in thread

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

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

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] 116+ messages in thread

* [PATCH 78/81] scsi: target: tcm-loop: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (76 preceding siblings ...)
  2023-03-04  0:30 ` [PATCH 77/81] scsi: rts5208: " Bart Van Assche
@ 2023-03-04  0:31 ` Bart Van Assche
  2023-03-04  0:31 ` [PATCH 79/81] scsi: ufs: " Bart Van Assche
                   ` (2 subsequent siblings)
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:31 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, 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 139031ccb700..e5f029b296e4 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] 116+ messages in thread

* [PATCH 79/81] scsi: ufs: Declare SCSI host template const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (77 preceding siblings ...)
  2023-03-04  0:31 ` [PATCH 78/81] scsi: target: tcm-loop: " Bart Van Assche
@ 2023-03-04  0:31 ` Bart Van Assche
  2023-03-04  0:31 ` [PATCH 80/81] usb: uas: Declare two host templates and host template pointers const Bart Van Assche
  2023-03-04  0:31 ` [PATCH 81/81] scsi: core: Update a source code comment Bart Van Assche
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:31 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 172d25fef740..42f01af1e1b7 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -8721,7 +8721,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] 116+ messages in thread

* [PATCH 80/81] usb: uas: Declare two host templates and host template pointers const
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (78 preceding siblings ...)
  2023-03-04  0:31 ` [PATCH 79/81] scsi: ufs: " Bart Van Assche
@ 2023-03-04  0:31 ` Bart Van Assche
  2023-03-04 15:51   ` Alan Stern
  2023-03-06 12:27   ` Oliver Neukum
  2023-03-04  0:31 ` [PATCH 81/81] scsi: core: Update a source code comment Bart Van Assche
  80 siblings, 2 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:31 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Oliver Neukum, linux-usb,
	Oliver Neukum, Greg Kroah-Hartman, Alan Stern

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

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] 116+ messages in thread

* [PATCH 81/81] scsi: core: Update a source code comment
  2023-03-04  0:29 [PATCH 00/81] Constify most SCSI host templates Bart Van Assche
                   ` (79 preceding siblings ...)
  2023-03-04  0:31 ` [PATCH 80/81] usb: uas: Declare two host templates and host template pointers const Bart Van Assche
@ 2023-03-04  0:31 ` Bart Van Assche
  80 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  0:31 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Christoph Hellwig, Ming Lei,
	Hannes Reinecke, John Garry, Mike Christie, James E.J. Bottomley

Make sure that the 'proc_name' comment correctly reflects its new role.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: John Garry <john.garry@huawei.com>
Cc: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 include/scsi/scsi_host.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 0f29799efa02..f3e071fd61bd 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -365,7 +365,7 @@ struct scsi_host_template {
 
 
 	/*
-	 * Name of proc directory
+	 * Name reported via the proc_name SCSI host attribute.
 	 */
 	const char *proc_name;
 

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

* Re: [PATCH 65/81] scsi: ps3rom: Declare SCSI host template const
  2023-03-04  0:30 ` [PATCH 65/81] scsi: ps3rom: " Bart Van Assche
@ 2023-03-04  0:53   ` Geoff Levand
  2023-03-04  2:25     ` Bart Van Assche
  2023-03-04 19:44   ` Geoff Levand
  1 sibling, 1 reply; 116+ messages in thread
From: Geoff Levand @ 2023-03-04  0:53 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen
  Cc: linux-scsi, James E.J. Bottomley, Michael Ellerman

Hi,

On 3/3/23 16:30, 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/scsi/ps3rom.c | 2 +-

I want to test this.  Please let me know where I can find the whole patch
series, or better, a git repository and branch I can clone.

Thanks.

-Geoff


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

* Re: [PATCH 44/81] scsi: ibmvfc: Declare SCSI host template const
  2023-03-04  0:30 ` [PATCH 44/81] scsi: ibmvfc: " Bart Van Assche
@ 2023-03-04  1:02   ` Tyrel Datwyler
  0 siblings, 0 replies; 116+ messages in thread
From: Tyrel Datwyler @ 2023-03-04  1:02 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen
  Cc: linux-scsi, Michael Ellerman, James E.J. Bottomley

On 3/3/23 16:30, 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: Tyrel Datwyler <tyreld@linux.ibm.com>


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

* Re: [PATCH 65/81] scsi: ps3rom: Declare SCSI host template const
  2023-03-04  0:53   ` Geoff Levand
@ 2023-03-04  2:25     ` Bart Van Assche
  0 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-04  2:25 UTC (permalink / raw)
  To: Geoff Levand, Martin K . Petersen
  Cc: linux-scsi, James E.J. Bottomley, Michael Ellerman

On 3/3/23 16:53, Geoff Levand wrote:
> I want to test this.  Please let me know where I can find the whole patch
> series, or better, a git repository and branch I can clone.

Thanks Geoff. A git branch is available here: 
https://github.com/bvanassche/linux/tree/scsi-const-host-template. The 
entire patch series is available at 
https://lore.kernel.org/linux-scsi/20230304003103.2572793-1-bvanassche@acm.org/T/#t.

Bart.


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

* Re: [PATCH 80/81] usb: uas: Declare two host templates and host template pointers const
  2023-03-04  0:31 ` [PATCH 80/81] usb: uas: Declare two host templates and host template pointers const Bart Van Assche
@ 2023-03-04 15:51   ` Alan Stern
  2023-03-06 12:27   ` Oliver Neukum
  1 sibling, 0 replies; 116+ messages in thread
From: Alan Stern @ 2023-03-04 15:51 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, linux-scsi, Oliver Neukum, linux-usb,
	Oliver Neukum, Greg Kroah-Hartman

On Fri, Mar 03, 2023 at 04:31:02PM -0800, Bart Van Assche wrote:
> Improve source code documentation by constifying host templates that are
> not modified.
> 
> Cc: Oliver Neukum <oneukum@suse.com>
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---

For the usb-storage parts:

Acked-by: Alan Stern <stern@rowland.harvard.edu>

>  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	[flat|nested] 116+ messages in thread

* Re: [PATCH 65/81] scsi: ps3rom: Declare SCSI host template const
  2023-03-04  0:30 ` [PATCH 65/81] scsi: ps3rom: " Bart Van Assche
  2023-03-04  0:53   ` Geoff Levand
@ 2023-03-04 19:44   ` Geoff Levand
  1 sibling, 0 replies; 116+ messages in thread
From: Geoff Levand @ 2023-03-04 19:44 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen
  Cc: linux-scsi, James E.J. Bottomley, Michael Ellerman

Hi,

On 3/3/23 16:30, 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/scsi/ps3rom.c | 2 +-

I rebased the current ps3-queue branch of my kernel.org ps3-linux.git repo
on top of your scsi-const-host-template branch and tested on PS3.  I could
mount and read a disk in the CD-ROM drive (the ps3rom device).

Thanks for your efforts.

Tested-by: Geoff Levand <geoff@infradead.org>



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

* Re: [PATCH 04/81] ata: Declare SCSI host templates const
  2023-03-04  0:29 ` [PATCH 04/81] ata: Declare SCSI host templates const Bart Van Assche
@ 2023-03-04 22:44   ` Linus Walleij
  2023-03-06  1:41   ` Damien Le Moal
  2023-03-07  2:00   ` Martin K. Petersen
  2 siblings, 0 replies; 116+ messages in thread
From: Linus Walleij @ 2023-03-04 22:44 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, linux-scsi, Damien Le Moal,
	Christoph Hellwig, Ming Lei, Hannes Reinecke, John Garry,
	Mike Christie, Shawn Guo, Sascha Hauer, Matthias Brugger,
	Hans de Goede, Jens Axboe, Patrice Chotard, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Thierry Reding, Jonathan Hunter,
	Viresh Kumar, Mikael Pettersson

On Sat, Mar 4, 2023 at 1:31 AM Bart Van Assche <bvanassche@acm.org> wrote:

> Make it explicit that ATA host templates are not modified.
>
> Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Ming Lei <ming.lei@redhat.com>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: John Garry <john.garry@huawei.com>
> Cc: Mike Christie <michael.christie@oracle.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Looks reasonable.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH 04/81] ata: Declare SCSI host templates const
  2023-03-04  0:29 ` [PATCH 04/81] ata: Declare SCSI host templates const Bart Van Assche
  2023-03-04 22:44   ` Linus Walleij
@ 2023-03-06  1:41   ` Damien Le Moal
  2023-03-07  2:00   ` Martin K. Petersen
  2 siblings, 0 replies; 116+ messages in thread
From: Damien Le Moal @ 2023-03-06  1:41 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen
  Cc: linux-scsi, Christoph Hellwig, Ming Lei, Hannes Reinecke,
	John Garry, Mike Christie, Shawn Guo, Sascha Hauer,
	Matthias Brugger, Hans de Goede, Jens Axboe, Patrice Chotard,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Thierry Reding,
	Jonathan Hunter, Viresh Kumar, Linus Walleij, Mikael Pettersson

On 3/4/23 09:29, Bart Van Assche wrote:
> Make it explicit that ATA host templates are not modified.
> 
> Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Ming Lei <ming.lei@redhat.com>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: John Garry <john.garry@huawei.com>
> Cc: Mike Christie <michael.christie@oracle.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Note: please cc linux-ide for ATA patches.

I cannot take this as it causes a warning without all patches.

drivers/ata/libata-scsi.c:4198:41: error: passing argument 1 of
‘scsi_host_alloc’ discards ‘const’ qualifier from pointer target type
[-Werror=discarded-qualifiers]
 4198 |                 shost = scsi_host_alloc(sht, sizeof(struct ata_port *));
      |                                         ^~~

Martin,

Can you take this one ?

Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

-- 
Damien Le Moal
Western Digital Research


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

* Re: [PATCH 41/81] scsi: hisi_sas: Declare SCSI host template const
  2023-03-04  0:30 ` [PATCH 41/81] scsi: hisi_sas: " Bart Van Assche
@ 2023-03-06  1:59   ` chenxiang (M)
  0 siblings, 0 replies; 116+ messages in thread
From: chenxiang (M) @ 2023-03-06  1:59 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen; +Cc: linux-scsi, James E.J. Bottomley


在 2023/3/4 8:30, Bart Van Assche 写道:
> Make it explicit that the SCSI host template is not modified.
>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Acked-by: Xiang Chen <chenxiang66@hisilicon.com>


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

* Re: [PATCH 76/81] scsi: xen-scsifront: Declare SCSI host template const
  2023-03-04  0:30 ` [PATCH 76/81] scsi: xen-scsifront: " Bart Van Assche
@ 2023-03-06  7:41   ` Juergen Gross
  0 siblings, 0 replies; 116+ messages in thread
From: Juergen Gross @ 2023-03-06  7:41 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen
  Cc: linux-scsi, Stefano Stabellini, James E.J. Bottomley


[-- Attachment #1.1.1: Type: text/plain, Size: 230 bytes --]

On 04.03.23 01:30, Bart Van Assche wrote:
> Make it explicit that the SCSI host template is not modified.
> 
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [PATCH 02/81] scsi: core: Declare most SCSI host template pointers const
  2023-03-04  0:29 ` [PATCH 02/81] scsi: core: Declare most SCSI host template pointers const Bart Van Assche
@ 2023-03-06 10:40   ` Benjamin Block
  2023-03-06 14:29   ` John Garry
  2023-03-07  0:04   ` Ming Lei
  2 siblings, 0 replies; 116+ messages in thread
From: Benjamin Block @ 2023-03-06 10:40 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, linux-scsi, Christoph Hellwig, Ming Lei,
	Hannes Reinecke, John Garry, Mike Christie, James E.J. Bottomley

On Fri, Mar 03, 2023 at 04:29:44PM -0800, Bart Van Assche wrote:
> Prepare for constifying most SCSI host template pointers by constifying
> the SCSI host template pointer arguments and variables in the SCSI core.
> 
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Ming Lei <ming.lei@redhat.com>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: John Garry <john.garry@huawei.com>
> 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(-)
> 

Looks good to me.


Reviewed-by: Benjamin Block <bblock@linux.ibm.com>

-- 
Best Regards, Benjamin Block  / Linux on IBM Z Kernel Development / IBM Systems
IBM Deutschland Research & Development GmbH    /    https://www.ibm.com/privacy
Vorsitz. AufsR.: Gregor Pillen         /         Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: AmtsG Stuttgart, HRB 243294

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

* Re: [PATCH 03/81] scsi: core: Declare SCSI host template pointer members const
  2023-03-04  0:29 ` [PATCH 03/81] scsi: core: Declare SCSI host template pointer members const Bart Van Assche
@ 2023-03-06 10:48   ` Benjamin Block
  2023-03-06 14:20   ` John Garry
  1 sibling, 0 replies; 116+ messages in thread
From: Benjamin Block @ 2023-03-06 10:48 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, linux-scsi, Christoph Hellwig, Ming Lei,
	Hannes Reinecke, John Garry, Mike Christie, James E.J. Bottomley

On Fri, Mar 03, 2023 at 04:29:45PM -0800, Bart Van Assche wrote:
> Declare the SCSI host template pointer members const and also the
> remaining SCSI host template pointers in the SCSI core.
> 
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Ming Lei <ming.lei@redhat.com>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: John Garry <john.garry@huawei.com>
> Cc: Mike Christie <michael.christie@oracle.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>  drivers/scsi/hosts.c       | 4 ++--
>  include/linux/raid_class.h | 2 +-
>  include/scsi/libfc.h       | 2 +-
>  include/scsi/scsi_host.h   | 4 ++--
>  4 files changed, 6 insertions(+), 6 deletions(-)
> 

Looks good to me.


Reviewed-by: Benjamin Block <bblock@linux.ibm.com>

-- 
Best Regards, Benjamin Block  / Linux on IBM Z Kernel Development / IBM Systems
IBM Deutschland Research & Development GmbH    /    https://www.ibm.com/privacy
Vorsitz. AufsR.: Gregor Pillen         /         Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: AmtsG Stuttgart, HRB 243294

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

* Re: [PATCH 08/81] scsi: zfcp: Declare SCSI host template const
  2023-03-04  0:29 ` [PATCH 08/81] scsi: zfcp: Declare SCSI host template const Bart Van Assche
@ 2023-03-06 10:51   ` Benjamin Block
  2023-03-06 10:58     ` Benjamin Block
  0 siblings, 1 reply; 116+ messages in thread
From: Benjamin Block @ 2023-03-06 10:51 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, linux-scsi, Steffen Maier, Heiko Carstens,
	Vasily Gorbik, Alexander Gordeev

On Fri, Mar 03, 2023 at 04:29:50PM -0800, 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/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,

Yup, good change IMO.


Acked-by: Benjamin Block <bblock@de.ibm.com>

-- 
Best Regards, Benjamin Block  / Linux on IBM Z Kernel Development / IBM Systems
IBM Deutschland Research & Development GmbH    /    https://www.ibm.com/privacy
Vorsitz. AufsR.: Gregor Pillen         /         Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: AmtsG Stuttgart, HRB 243294

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

* Re: [PATCH 08/81] scsi: zfcp: Declare SCSI host template const
  2023-03-06 10:51   ` Benjamin Block
@ 2023-03-06 10:58     ` Benjamin Block
  0 siblings, 0 replies; 116+ messages in thread
From: Benjamin Block @ 2023-03-06 10:58 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, linux-scsi, Steffen Maier, Heiko Carstens,
	Vasily Gorbik, Alexander Gordeev

On Mon, Mar 06, 2023 at 10:51:52AM +0000, Benjamin Block wrote:
> On Fri, Mar 03, 2023 at 04:29:50PM -0800, 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/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,
> 
> Yup, good change IMO.
> 
> 
> Acked-by: Benjamin Block <bblock@de.ibm.com>
> 

Oups. Sorry. That's the wrong email address.

Acked-by: Benjamin Block <bblock@linux.ibm.com>

-- 
Best Regards, Benjamin Block  / Linux on IBM Z Kernel Development / IBM Systems
IBM Deutschland Research & Development GmbH    /    https://www.ibm.com/privacy
Vorsitz. AufsR.: Gregor Pillen         /         Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: AmtsG Stuttgart, HRB 243294

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

* Re: [PATCH 80/81] usb: uas: Declare two host templates and host template pointers const
  2023-03-04  0:31 ` [PATCH 80/81] usb: uas: Declare two host templates and host template pointers const Bart Van Assche
  2023-03-04 15:51   ` Alan Stern
@ 2023-03-06 12:27   ` Oliver Neukum
  1 sibling, 0 replies; 116+ messages in thread
From: Oliver Neukum @ 2023-03-06 12:27 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen
  Cc: linux-scsi, Oliver Neukum, linux-usb, Oliver Neukum,
	Greg Kroah-Hartman, Alan Stern



On 04.03.23 01:31, Bart Van Assche wrote:
> Improve source code documentation by constifying host templates that are
> not modified.
> 
> Cc: Oliver Neukum <oneukum@suse.com>
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Oliver Neukum <oneukum@suse.com>

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

* Re: [PATCH 01/81] scsi: qla2xxx: Refer directly to the qla2xxx_driver_template
  2023-03-04  0:29 ` [PATCH 01/81] scsi: qla2xxx: Refer directly to the qla2xxx_driver_template Bart Van Assche
@ 2023-03-06 13:10   ` John Garry
  2023-03-06 13:51     ` Bart Van Assche
  2023-03-09 18:42     ` Bart Van Assche
  0 siblings, 2 replies; 116+ messages in thread
From: John Garry @ 2023-03-06 13:10 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen
  Cc: linux-scsi, Nilesh Javali, GR-QLogic-Storage-Upstream,
	James E.J. Bottomley

On 04/03/2023 00:29, Bart Van Assche wrote:
> 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 | 4 ++--

Hi Bart,

>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
> index aa0cf5ca6c1c..8d9a6aa3ea61 100644
> --- a/drivers/scsi/qla2xxx/qla_target.c
> +++ b/drivers/scsi/qla2xxx/qla_target.c
> @@ -6395,8 +6395,8 @@ 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;
> +	if (!(qla2xxx_driver_template.supported_mode & MODE_TARGET))
> +		qla2xxx_driver_template.supported_mode |= MODE_TARGET;

So we're saying if that MODE_TARGET bit is not set, then set it. It 
would be neater to just always set it, right?

Apart from that, I will say that I haven't studied the driver in detail, 
but my impression is that we should just set this flag per-shost in 
base_vha->host.active_mode, and not the host template supported_mode 
member. Indeed, we don't even seem to be making this driver 
scsi_host_template as const in this series, which I thought was the aim 
(and I assume because of this).

Thanks,
John

>   
>   	rc = btree_init64(&tgt->lun_qpair_map);
>   	if (rc) {


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

* Re: [PATCH 01/81] scsi: qla2xxx: Refer directly to the qla2xxx_driver_template
  2023-03-06 13:10   ` John Garry
@ 2023-03-06 13:51     ` Bart Van Assche
  2023-03-09 18:42     ` Bart Van Assche
  1 sibling, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-06 13:51 UTC (permalink / raw)
  To: John Garry, Martin K . Petersen
  Cc: linux-scsi, Nilesh Javali, GR-QLogic-Storage-Upstream,
	James E.J. Bottomley

On 3/6/23 05:10, John Garry wrote:
> On 04/03/2023 00:29, Bart Van Assche wrote:
>> --- a/drivers/scsi/qla2xxx/qla_target.c
>> +++ b/drivers/scsi/qla2xxx/qla_target.c
>> @@ -6395,8 +6395,8 @@ 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;
>> +    if (!(qla2xxx_driver_template.supported_mode & MODE_TARGET))
>> +        qla2xxx_driver_template.supported_mode |= MODE_TARGET;
> 
> So we're saying if that MODE_TARGET bit is not set, then set it. It 
> would be neater to just always set it, right?
> 
> Apart from that, I will say that I haven't studied the driver in detail, 
> but my impression is that we should just set this flag per-shost in 
> base_vha->host.active_mode, and not the host template supported_mode 
> member. Indeed, we don't even seem to be making this driver 
> scsi_host_template as const in this series, which I thought was the aim 
> (and I assume because of this).

Hi John,

If I have to repost this patch series I will implement this suggestion.

Thanks,

Bart.


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

* Re: [PATCH 03/81] scsi: core: Declare SCSI host template pointer members const
  2023-03-04  0:29 ` [PATCH 03/81] scsi: core: Declare SCSI host template pointer members const Bart Van Assche
  2023-03-06 10:48   ` Benjamin Block
@ 2023-03-06 14:20   ` John Garry
  1 sibling, 0 replies; 116+ messages in thread
From: John Garry @ 2023-03-06 14:20 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen
  Cc: linux-scsi, Christoph Hellwig, Ming Lei, Hannes Reinecke,
	Mike Christie, James E.J. Bottomley

On 04/03/2023 00:29, Bart Van Assche wrote:
> Declare the SCSI host template pointer members const and also the
> remaining SCSI host template pointers in the SCSI core.
> 
> Cc: Christoph Hellwig<hch@lst.de>
> Cc: Ming Lei<ming.lei@redhat.com>
> Cc: Hannes Reinecke<hare@suse.de>
> Cc: John Garry<john.garry@huawei.com>
> Cc: Mike Christie<michael.christie@oracle.com>
> Signed-off-by: Bart Van Assche<bvanassche@acm.org>

Reviewed-by: John Garry <john.g.garry@oracle.com>

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

* Re: [PATCH 02/81] scsi: core: Declare most SCSI host template pointers const
  2023-03-04  0:29 ` [PATCH 02/81] scsi: core: Declare most SCSI host template pointers const Bart Van Assche
  2023-03-06 10:40   ` Benjamin Block
@ 2023-03-06 14:29   ` John Garry
  2023-03-06 16:07     ` Bart Van Assche
  2023-03-07  0:04   ` Ming Lei
  2 siblings, 1 reply; 116+ messages in thread
From: John Garry @ 2023-03-06 14:29 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen
  Cc: linux-scsi, Christoph Hellwig, Ming Lei, Hannes Reinecke,
	Mike Christie, James E.J. Bottomley

On 04/03/2023 00:29, Bart Van Assche wrote:
> Prepare for constifying most SCSI host template pointers by constifying
> the SCSI host template pointer arguments and variables in the SCSI core.
> 
> Cc: Christoph Hellwig<hch@lst.de>
> Cc: Ming Lei<ming.lei@redhat.com>
> Cc: Hannes Reinecke<hare@suse.de>
> Cc: John Garry<john.garry@huawei.com>
> Cc: Mike Christie<michael.christie@oracle.com>
> Signed-off-by: Bart Van Assche<bvanassche@acm.org>

Hi Bart,

You wrote that most pointers were now cast as const - which ones where 
not? From a quick scan they all seem to be const

Apart from that:
Reviewed-by: John Garry <john.g.garry@oracle.com>

Thanks,
John

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

* Re: [PATCH 02/81] scsi: core: Declare most SCSI host template pointers const
  2023-03-06 14:29   ` John Garry
@ 2023-03-06 16:07     ` Bart Van Assche
  2023-03-06 18:55       ` John Garry
  0 siblings, 1 reply; 116+ messages in thread
From: Bart Van Assche @ 2023-03-06 16:07 UTC (permalink / raw)
  To: John Garry, Martin K . Petersen
  Cc: linux-scsi, Christoph Hellwig, Ming Lei, Hannes Reinecke,
	Mike Christie, James E.J. Bottomley

On 3/6/23 06:29, John Garry wrote:
> You wrote that most pointers were now cast as const - which ones where 
> not? From a quick scan they all seem to be const

Hi Garry,

Some SCSI drivers modify one of more members of the SCSI host template. 
An example can be found in drivers/scsi/pcmcia/nsp_cs.c:

	sht->name	  = data->nspinfo;

Another example from drivers/scsi/bnx2fc/bnx2fc_fcoe.c:

	bnx2fc_shost_template.can_queue = hba->max_outstanding_cmds;

Thanks,

Bart.

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

* Re: [PATCH 48/81] scsi: iscsi: Declare SCSI host template const
  2023-03-04  0:30 ` [PATCH 48/81] scsi: iscsi: " Bart Van Assche
@ 2023-03-06 17:20   ` Mike Christie
  2023-03-07  2:02     ` Martin K. Petersen
  0 siblings, 1 reply; 116+ messages in thread
From: Mike Christie @ 2023-03-06 17:20 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen
  Cc: linux-scsi, Sagi Grimberg, Max Gurtovoy, Jason Gunthorpe,
	Leon Romanovsky, Ketan Mukadam, James E.J. Bottomley,
	Nilesh Javali, Manish Rangankar, GR-QLogic-Storage-Upstream,
	Varun Prakash, Artur Paszkiewicz, Lee Duncan, Chris Leech,
	Jesper Juhl

On 3/3/23 6:30 PM, 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/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/isci/init.c                 | 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 +-

iscsi parts look ok. The isci driver is actually sas and it also looked ok.

Reviewed-by: Mike Christie <michael.christie@oracle.com>


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

* Re: [PATCH 02/81] scsi: core: Declare most SCSI host template pointers const
  2023-03-06 16:07     ` Bart Van Assche
@ 2023-03-06 18:55       ` John Garry
  2023-03-06 19:41         ` Bart Van Assche
  0 siblings, 1 reply; 116+ messages in thread
From: John Garry @ 2023-03-06 18:55 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen
  Cc: linux-scsi, Christoph Hellwig, Ming Lei, Hannes Reinecke,
	Mike Christie, James E.J. Bottomley

On 06/03/2023 16:07, Bart Van Assche wrote:
> On 3/6/23 06:29, John Garry wrote:
>> You wrote that most pointers were now cast as const - which ones were 
>> not? From a quick scan they all seem to be const
> 
> Hi Garry,
> 
> Some SCSI drivers modify one of more members of the SCSI host template. 
> An example can be found in drivers/scsi/pcmcia/nsp_cs.c:

I seemed to get the wrong idea of what you meant in the commit message. 
When you wrote "Prepare for constifying most SCSI host template 
pointers", I got the impression that most of the pointers to SCSI host 
template in the core code were going to be pointers to const. However 
you really meant that most of the per-driver SCSI host template 
instances would be const.

Anyway,

Reviewed-by: John Garry <john.g.garry@oracle.com>

> 
>      sht->name      = data->nspinfo;
> 
> Another example from drivers/scsi/bnx2fc/bnx2fc_fcoe.c:
> 
>      bnx2fc_shost_template.can_queue = hba->max_outstanding_cmds;

BTW, surely we should be setting shost->can_queue = 
hba->max_outstanding_cmds after scsi_host_alloc() and not modifying 
bnx2fc_shost_template, right? The series is already huge, so this stuff 
would be done separately, I suppose.

Thanks,
John


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

* Re: [PATCH 02/81] scsi: core: Declare most SCSI host template pointers const
  2023-03-06 18:55       ` John Garry
@ 2023-03-06 19:41         ` Bart Van Assche
  2023-03-06 23:34           ` Finn Thain
  0 siblings, 1 reply; 116+ messages in thread
From: Bart Van Assche @ 2023-03-06 19:41 UTC (permalink / raw)
  To: John Garry, Martin K . Petersen
  Cc: linux-scsi, Christoph Hellwig, Ming Lei, Hannes Reinecke,
	Mike Christie, James E.J. Bottomley

On 3/6/23 10:55, John Garry wrote:
> On 06/03/2023 16:07, Bart Van Assche wrote:
>> Another example from drivers/scsi/bnx2fc/bnx2fc_fcoe.c:
>>
>>      bnx2fc_shost_template.can_queue = hba->max_outstanding_cmds;
> 
> BTW, surely we should be setting shost->can_queue = 
> hba->max_outstanding_cmds after scsi_host_alloc() and not modifying 
> bnx2fc_shost_template, right? The series is already huge, so this stuff 
> would be done separately, I suppose.

Hi John,

If anyone else wants to work on this that's fine with me. My view is 
that the SCSI core should support declaring host templates const but I'm 
not sure it's worth it to make changes in old drivers such that their 
SCSI host template can be declared const. One class of SCSI LLDs that 
does not have a const SCSI host template are the NCR drivers. The NCR 
SCSI host controller was popular 40 years ago. There are probably not 
many working SCSI devices left that are based on this SCSI controller.

Bart.


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

* Re: [PATCH 02/81] scsi: core: Declare most SCSI host template pointers const
  2023-03-06 19:41         ` Bart Van Assche
@ 2023-03-06 23:34           ` Finn Thain
  2023-03-06 23:41             ` Bart Van Assche
  0 siblings, 1 reply; 116+ messages in thread
From: Finn Thain @ 2023-03-06 23:34 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: John Garry, Martin K . Petersen, linux-scsi, Christoph Hellwig,
	Ming Lei, Hannes Reinecke, Mike Christie, James E.J. Bottomley

[-- Attachment #1: Type: text/plain, Size: 1290 bytes --]

On Mon, 6 Mar 2023, Bart Van Assche wrote:

> On 3/6/23 10:55, John Garry wrote:
> > On 06/03/2023 16:07, Bart Van Assche wrote:
> >> Another example from drivers/scsi/bnx2fc/bnx2fc_fcoe.c:
> >>
> >>      bnx2fc_shost_template.can_queue = hba->max_outstanding_cmds;
> > 
> > BTW, surely we should be setting shost->can_queue =
> > hba->max_outstanding_cmds after scsi_host_alloc() and not modifying
> > bnx2fc_shost_template, right? The series is already huge, so this stuff
> > would be done separately, I suppose.
> 
> Hi John,
> 
> If anyone else wants to work on this that's fine with me. My view is 
> that the SCSI core should support declaring host templates const but I'm 
> not sure it's worth it to make changes in old drivers such that their 
> SCSI host template can be declared const.

Would it alter the driver .o files? If not, the changes won't require 
actual testing.

> One class of SCSI LLDs that does not have a const SCSI host template are 
> the NCR drivers. The NCR SCSI host controller was popular 40 years ago. 
> There are probably not many working SCSI devices left that are based on 
> this SCSI controller.
> 

True, the NCR 5380 controller was popular 40 years ago among early 
adopters like Sun and Apple. Is this relevant?

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

* Re: [PATCH 02/81] scsi: core: Declare most SCSI host template pointers const
  2023-03-06 23:34           ` Finn Thain
@ 2023-03-06 23:41             ` Bart Van Assche
  0 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-06 23:41 UTC (permalink / raw)
  To: Finn Thain
  Cc: John Garry, Martin K . Petersen, linux-scsi, Christoph Hellwig,
	Ming Lei, Hannes Reinecke, Mike Christie, James E.J. Bottomley

On 3/6/23 15:34, Finn Thain wrote:
> Would it alter the driver .o files? If not, the changes won't require
> actual testing.

Hi Finn,

My understanding is that declaring a static data structure const may 
move it to another section in the .o file but otherwise that the .o file 
should not be affected. I agree that retesting shouldn't be necessary 
for patches that only involve making data structures const.

Thanks,

Bart.


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

* Re: [PATCH 12/81] scsi: BusLogic: Declare SCSI host template const
  2023-03-04  0:29 ` [PATCH 12/81] scsi: BusLogic: " Bart Van Assche
@ 2023-03-06 23:42   ` Khalid Aziz
  0 siblings, 0 replies; 116+ messages in thread
From: Khalid Aziz @ 2023-03-06 23:42 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen; +Cc: linux-scsi, James E.J. Bottomley

On 3/3/23 5:29 PM, 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/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_wr

Looks good to me.

Acked-by: Khalid Aziz <khalid@gonehiking.org>

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

* Re: [PATCH 02/81] scsi: core: Declare most SCSI host template pointers const
  2023-03-04  0:29 ` [PATCH 02/81] scsi: core: Declare most SCSI host template pointers const Bart Van Assche
  2023-03-06 10:40   ` Benjamin Block
  2023-03-06 14:29   ` John Garry
@ 2023-03-07  0:04   ` Ming Lei
  2 siblings, 0 replies; 116+ messages in thread
From: Ming Lei @ 2023-03-07  0:04 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, linux-scsi, Christoph Hellwig,
	Hannes Reinecke, John Garry, Mike Christie, James E.J. Bottomley

On Sat, Mar 4, 2023 at 8:31 AM Bart Van Assche <bvanassche@acm.org> wrote:
>
> Prepare for constifying most SCSI host template pointers by constifying
> the SCSI host template pointer arguments and variables in the SCSI core.
>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Ming Lei <ming.lei@redhat.com>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: John Garry <john.garry@huawei.com>
> Cc: Mike Christie <michael.christie@oracle.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Reviewed-by: Ming Lei <ming.lei@redhat.com>


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

* Re: [PATCH 04/81] ata: Declare SCSI host templates const
  2023-03-04  0:29 ` [PATCH 04/81] ata: Declare SCSI host templates const Bart Van Assche
  2023-03-04 22:44   ` Linus Walleij
  2023-03-06  1:41   ` Damien Le Moal
@ 2023-03-07  2:00   ` Martin K. Petersen
  2023-03-07  2:53     ` Bart Van Assche
  2023-03-07  3:29     ` Damien Le Moal
  2 siblings, 2 replies; 116+ messages in thread
From: Martin K. Petersen @ 2023-03-07  2:00 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, linux-scsi, Damien Le Moal,
	Christoph Hellwig, Ming Lei, Hannes Reinecke, John Garry,
	Mike Christie, Shawn Guo, Sascha Hauer, Matthias Brugger,
	Hans de Goede, Jens Axboe, Patrice Chotard, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Thierry Reding, Jonathan Hunter,
	Viresh Kumar, Linus Walleij, Mikael Pettersson


Hi Bart!

> Make it explicit that ATA host templates are not modified.

>  drivers/ata/pata_atiixp.c       |   2 +-
>  drivers/ata/pata_atp867x.c      |   2 +-
>  drivers/ata/pata_bk3710.c       | 380 ++++++++++++++++++++++++++++++++
   ^^^^^^^^^^^^^^^^^^^^^^^^^
Don't believe you meant to add this...
>  drivers/ata/pata_buddha.c       |   2 +-
>  drivers/ata/pata_cmd640.c       |   2 +-

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH 48/81] scsi: iscsi: Declare SCSI host template const
  2023-03-06 17:20   ` Mike Christie
@ 2023-03-07  2:02     ` Martin K. Petersen
  2023-03-07  2:57       ` Bart Van Assche
  0 siblings, 1 reply; 116+ messages in thread
From: Martin K. Petersen @ 2023-03-07  2:02 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Mike Christie, Martin K . Petersen, linux-scsi, Sagi Grimberg,
	Max Gurtovoy, Jason Gunthorpe, Leon Romanovsky, Ketan Mukadam,
	James E.J. Bottomley, Nilesh Javali, Manish Rangankar,
	GR-QLogic-Storage-Upstream, Varun Prakash, Artur Paszkiewicz,
	Lee Duncan, Chris Leech, Jesper Juhl


Mike,

> The isci driver is actually sas and it also looked ok.

Yes.

Bart: Please put isci in a separate patch.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH 04/81] ata: Declare SCSI host templates const
  2023-03-07  2:00   ` Martin K. Petersen
@ 2023-03-07  2:53     ` Bart Van Assche
  2023-03-07  3:29     ` Damien Le Moal
  1 sibling, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-07  2:53 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: linux-scsi, Damien Le Moal, Christoph Hellwig, Ming Lei,
	Hannes Reinecke, John Garry, Mike Christie, Shawn Guo,
	Sascha Hauer, Matthias Brugger, Hans de Goede, Jens Axboe,
	Patrice Chotard, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	Thierry Reding, Jonathan Hunter, Viresh Kumar, Linus Walleij,
	Mikael Pettersson

On 3/6/23 18:00, Martin K. Petersen wrote:
>> Make it explicit that ATA host templates are not modified.
> 
>>   drivers/ata/pata_atiixp.c       |   2 +-
>>   drivers/ata/pata_atp867x.c      |   2 +-
>>   drivers/ata/pata_bk3710.c       | 380 ++++++++++++++++++++++++++++++++
>     ^^^^^^^^^^^^^^^^^^^^^^^^^
> Don't believe you meant to add this...

Hi Martin,

Thanks for having reported this. The above is the result of having 
resolved a rebase conflict incorrectly. I will remove file 
drivers/ata/pata_bk3710.c from this patch.

Thanks,

Bart.

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

* Re: [PATCH 48/81] scsi: iscsi: Declare SCSI host template const
  2023-03-07  2:02     ` Martin K. Petersen
@ 2023-03-07  2:57       ` Bart Van Assche
  0 siblings, 0 replies; 116+ messages in thread
From: Bart Van Assche @ 2023-03-07  2:57 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Mike Christie, linux-scsi, Sagi Grimberg, Max Gurtovoy,
	Jason Gunthorpe, Leon Romanovsky, Ketan Mukadam,
	James E.J. Bottomley, Nilesh Javali, Manish Rangankar,
	GR-QLogic-Storage-Upstream, Varun Prakash, Artur Paszkiewicz,
	Lee Duncan, Chris Leech, Jesper Juhl

On 3/6/23 18:02, Martin K. Petersen wrote:
> Bart: Please put isci in a separate patch.

I will do that.

Thanks,

Bart.



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

* Re: [PATCH 04/81] ata: Declare SCSI host templates const
  2023-03-07  2:00   ` Martin K. Petersen
  2023-03-07  2:53     ` Bart Van Assche
@ 2023-03-07  3:29     ` Damien Le Moal
  1 sibling, 0 replies; 116+ messages in thread
From: Damien Le Moal @ 2023-03-07  3:29 UTC (permalink / raw)
  To: Martin K. Petersen, Bart Van Assche
  Cc: linux-scsi, Christoph Hellwig, Ming Lei, Hannes Reinecke,
	John Garry, Mike Christie, Shawn Guo, Sascha Hauer,
	Matthias Brugger, Hans de Goede, Jens Axboe, Patrice Chotard,
	Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, Thierry Reding,
	Jonathan Hunter, Viresh Kumar, Linus Walleij, Mikael Pettersson

On 3/7/23 11:00, Martin K. Petersen wrote:
> 
> Hi Bart!
> 
>> Make it explicit that ATA host templates are not modified.
> 
>>  drivers/ata/pata_atiixp.c       |   2 +-
>>  drivers/ata/pata_atp867x.c      |   2 +-
>>  drivers/ata/pata_bk3710.c       | 380 ++++++++++++++++++++++++++++++++
>    ^^^^^^^^^^^^^^^^^^^^^^^^^
> Don't believe you meant to add this...

Oops. Yes, indeed, good catch !

>>  drivers/ata/pata_buddha.c       |   2 +-
>>  drivers/ata/pata_cmd640.c       |   2 +-
> 

-- 
Damien Le Moal
Western Digital Research


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

* Re: [PATCH 01/81] scsi: qla2xxx: Refer directly to the qla2xxx_driver_template
  2023-03-06 13:10   ` John Garry
  2023-03-06 13:51     ` Bart Van Assche
@ 2023-03-09 18:42     ` Bart Van Assche
  2023-03-09 18:59       ` John Garry
  1 sibling, 1 reply; 116+ messages in thread
From: Bart Van Assche @ 2023-03-09 18:42 UTC (permalink / raw)
  To: John Garry, Martin K . Petersen
  Cc: linux-scsi, Nilesh Javali, GR-QLogic-Storage-Upstream,
	James E.J. Bottomley

On 3/6/23 05:10, John Garry wrote:
> Apart from that, I will say that I haven't studied the driver in detail, 
> but my impression is that we should just set this flag per-shost in 
> base_vha->host.active_mode, and not the host template supported_mode 
> member. Indeed, we don't even seem to be making this driver 
> scsi_host_template as const in this series, which I thought was the aim 
> (and I assume because of this).

This patch is necessary because this patch prevents to declare the 
'hostt' member of struct Scsi_Host const.

Thanks,

Bart.

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

* Re: [PATCH 47/81] scsi: ipr: Declare SCSI host template const
  2023-03-04  0:30 ` [PATCH 47/81] scsi: ipr: " Bart Van Assche
@ 2023-03-09 18:53   ` Brian King
  0 siblings, 0 replies; 116+ messages in thread
From: Brian King @ 2023-03-09 18:53 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen
  Cc: linux-scsi, Brian King, James E.J. Bottomley

On 3/3/23 6:30 PM, 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/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,

Acked-by: Brian King <brking@linux.vnet.ibm.com>

-- 
Brian King
Power Linux I/O
IBM Linux Technology Center



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

* Re: [PATCH 01/81] scsi: qla2xxx: Refer directly to the qla2xxx_driver_template
  2023-03-09 18:42     ` Bart Van Assche
@ 2023-03-09 18:59       ` John Garry
  0 siblings, 0 replies; 116+ messages in thread
From: John Garry @ 2023-03-09 18:59 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen
  Cc: linux-scsi, Nilesh Javali, GR-QLogic-Storage-Upstream,
	James E.J. Bottomley

On 09/03/2023 18:42, Bart Van Assche wrote:
> On 3/6/23 05:10, John Garry wrote:
>> Apart from that, I will say that I haven't studied the driver in 
>> detail, but my impression is that we should just set this flag 
>> per-shost in base_vha->host.active_mode, and not the host template 
>> supported_mode member. Indeed, we don't even seem to be making this 
>> driver scsi_host_template as const in this series, which I thought was 
>> the aim (and I assume because of this).
> 
> This patch is necessary because this patch prevents to declare the 
> 'hostt' member of struct Scsi_Host const.

ok, sure, but I am just saying that that the pre-existing code looks 
suspicious. However, as I mentioned before, things like this (modifying 
the host template) could be improved later by someone.

Thanks,
John

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

end of thread, other threads:[~2023-03-09 19:01 UTC | newest]

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.