Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: iscsi: Declare SCSI host template const

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

Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230322195515.1267197-50-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
80602aca eb60d17a

+14 -14
+2 -2
drivers/infiniband/ulp/iser/iscsi_iser.c
··· 78 78 MODULE_LICENSE("Dual BSD/GPL"); 79 79 MODULE_AUTHOR("Alex Nezhinsky, Dan Bar Dov, Or Gerlitz"); 80 80 81 - static struct scsi_host_template iscsi_iser_sht; 81 + static const struct scsi_host_template iscsi_iser_sht; 82 82 static struct iscsi_transport iscsi_iser_transport; 83 83 static struct scsi_transport_template *iscsi_iser_scsi_transport; 84 84 static struct workqueue_struct *release_wq; ··· 956 956 return 0; 957 957 } 958 958 959 - static struct scsi_host_template iscsi_iser_sht = { 959 + static const struct scsi_host_template iscsi_iser_sht = { 960 960 .module = THIS_MODULE, 961 961 .name = "iSCSI Initiator over iSER", 962 962 .queuecommand = iscsi_queuecommand,
+1 -1
drivers/scsi/be2iscsi/be_main.c
··· 398 398 MODULE_DEVICE_TABLE(pci, beiscsi_pci_id_table); 399 399 400 400 401 - static struct scsi_host_template beiscsi_sht = { 401 + static const struct scsi_host_template beiscsi_sht = { 402 402 .module = THIS_MODULE, 403 403 .name = "Emulex 10Gbe open-iscsi Initiator Driver", 404 404 .proc_name = DRV_NAME,
+2 -2
drivers/scsi/bnx2i/bnx2i_iscsi.c
··· 22 22 23 23 struct scsi_transport_template *bnx2i_scsi_xport_template; 24 24 struct iscsi_transport bnx2i_iscsi_transport; 25 - static struct scsi_host_template bnx2i_host_template; 25 + static const struct scsi_host_template bnx2i_host_template; 26 26 27 27 /* 28 28 * Global endpoint resource info ··· 2250 2250 * 'Scsi_Host_Template' structure and 'iscsi_tranport' structure template 2251 2251 * used while registering with the scsi host and iSCSI transport module. 2252 2252 */ 2253 - static struct scsi_host_template bnx2i_host_template = { 2253 + static const struct scsi_host_template bnx2i_host_template = { 2254 2254 .module = THIS_MODULE, 2255 2255 .name = "QLogic Offload iSCSI Initiator", 2256 2256 .proc_name = "bnx2i",
+1 -1
drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
··· 80 80 .event_handler = cxgb3i_dev_event_handler, 81 81 }; 82 82 83 - static struct scsi_host_template cxgb3i_host_template = { 83 + static const struct scsi_host_template cxgb3i_host_template = { 84 84 .module = THIS_MODULE, 85 85 .name = DRV_MODULE_NAME, 86 86 .proc_name = DRV_MODULE_NAME,
+1 -1
drivers/scsi/cxgbi/libcxgbi.c
··· 337 337 EXPORT_SYMBOL_GPL(cxgbi_hbas_remove); 338 338 339 339 int cxgbi_hbas_add(struct cxgbi_device *cdev, u64 max_lun, 340 - unsigned int max_conns, struct scsi_host_template *sht, 340 + unsigned int max_conns, const struct scsi_host_template *sht, 341 341 struct scsi_transport_template *stt) 342 342 { 343 343 struct cxgbi_hba *chba;
+1 -1
drivers/scsi/cxgbi/libcxgbi.h
··· 591 591 struct cxgbi_device *cxgbi_device_find_by_netdev_rcu(struct net_device *, 592 592 int *); 593 593 int cxgbi_hbas_add(struct cxgbi_device *, u64, unsigned int, 594 - struct scsi_host_template *, 594 + const struct scsi_host_template *, 595 595 struct scsi_transport_template *); 596 596 void cxgbi_hbas_remove(struct cxgbi_device *); 597 597
+2 -2
drivers/scsi/iscsi_tcp.c
··· 47 47 MODULE_LICENSE("GPL"); 48 48 49 49 static struct scsi_transport_template *iscsi_sw_tcp_scsi_transport; 50 - static struct scsi_host_template iscsi_sw_tcp_sht; 50 + static const struct scsi_host_template iscsi_sw_tcp_sht; 51 51 static struct iscsi_transport iscsi_sw_tcp_transport; 52 52 53 53 static unsigned int iscsi_max_lun = ~0; ··· 1072 1072 return 0; 1073 1073 } 1074 1074 1075 - static struct scsi_host_template iscsi_sw_tcp_sht = { 1075 + static const struct scsi_host_template iscsi_sw_tcp_sht = { 1076 1076 .module = THIS_MODULE, 1077 1077 .name = "iSCSI Initiator over TCP/IP", 1078 1078 .queuecommand = iscsi_queuecommand,
+1 -1
drivers/scsi/libiscsi.c
··· 2895 2895 * This should be called by partial offload and software iscsi drivers. 2896 2896 * To access the driver specific memory use the iscsi_host_priv() macro. 2897 2897 */ 2898 - struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht, 2898 + struct Scsi_Host *iscsi_host_alloc(const struct scsi_host_template *sht, 2899 2899 int dd_data_size, bool xmit_can_sleep) 2900 2900 { 2901 2901 struct Scsi_Host *shost;
+1 -1
drivers/scsi/qedi/qedi_gbl.h
··· 17 17 18 18 extern uint qedi_io_tracing; 19 19 20 - extern struct scsi_host_template qedi_host_template; 20 + extern const struct scsi_host_template qedi_host_template; 21 21 extern struct iscsi_transport qedi_iscsi_transport; 22 22 extern const struct qed_iscsi_ops *qedi_ops; 23 23 extern const struct qedi_debugfs_ops qedi_debugfs_ops[];
+1 -1
drivers/scsi/qedi/qedi_iscsi.c
··· 40 40 return qedi_recover_all_conns(qedi); 41 41 } 42 42 43 - struct scsi_host_template qedi_host_template = { 43 + const struct scsi_host_template qedi_host_template = { 44 44 .module = THIS_MODULE, 45 45 .name = "QLogic QEDI 25/40/100Gb iSCSI Initiator Driver", 46 46 .proc_name = QEDI_MODULE_NAME,
+1 -1
include/scsi/libiscsi.h
··· 407 407 extern int iscsi_host_get_param(struct Scsi_Host *shost, 408 408 enum iscsi_host_param param, char *buf); 409 409 extern int iscsi_host_add(struct Scsi_Host *shost, struct device *pdev); 410 - extern struct Scsi_Host *iscsi_host_alloc(struct scsi_host_template *sht, 410 + extern struct Scsi_Host *iscsi_host_alloc(const struct scsi_host_template *sht, 411 411 int dd_data_size, 412 412 bool xmit_can_sleep); 413 413 extern void iscsi_host_remove(struct Scsi_Host *shost, bool is_shutdown);