From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
Sagi Grimberg <sagi@grimberg.me>,
Max Gurtovoy <mgurtovoy@nvidia.com>,
Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
Ketan Mukadam <ketan.mukadam@broadcom.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
Nilesh Javali <njavali@marvell.com>,
Manish Rangankar <mrangankar@marvell.com>,
GR-QLogic-Storage-Upstream@marvell.com,
Varun Prakash <varun@chelsio.com>,
Artur Paszkiewicz <artur.paszkiewicz@intel.com>,
Lee Duncan <lduncan@suse.com>, Chris Leech <cleech@redhat.com>,
Mike Christie <michael.christie@oracle.com>,
Jesper Juhl <jesperjuhl76@gmail.com>
Subject: [PATCH 48/81] scsi: iscsi: Declare SCSI host template const
Date: Fri, 3 Mar 2023 16:30:30 -0800 [thread overview]
Message-ID: <20230304003103.2572793-49-bvanassche@acm.org> (raw)
In-Reply-To: <20230304003103.2572793-1-bvanassche@acm.org>
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);
next prev parent reply other threads:[~2023-03-04 0:34 UTC|newest]
Thread overview: 116+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Bart Van Assche [this message]
2023-03-06 17:20 ` [PATCH 48/81] scsi: iscsi: " 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230304003103.2572793-49-bvanassche@acm.org \
--to=bvanassche@acm.org \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=artur.paszkiewicz@intel.com \
--cc=cleech@redhat.com \
--cc=jejb@linux.ibm.com \
--cc=jesperjuhl76@gmail.com \
--cc=jgg@ziepe.ca \
--cc=ketan.mukadam@broadcom.com \
--cc=lduncan@suse.com \
--cc=leon@kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mgurtovoy@nvidia.com \
--cc=michael.christie@oracle.com \
--cc=mrangankar@marvell.com \
--cc=njavali@marvell.com \
--cc=sagi@grimberg.me \
--cc=varun@chelsio.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox