scsi: esp_scsi: Declare SCSI host template const
authorBart Van Assche <bvanassche@acm.org>
Wed, 22 Mar 2023 19:54:29 +0000 (12:54 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 24 Mar 2023 23:19:22 +0000 (19:19 -0400)
Make it explicit that the SCSI host template is not modified.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230322195515.1267197-35-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/am53c974.c
drivers/scsi/esp_scsi.c
drivers/scsi/esp_scsi.h
drivers/scsi/jazz_esp.c
drivers/scsi/mac_esp.c
drivers/scsi/sun3x_esp.c
drivers/scsi/sun_esp.c
drivers/scsi/zorro_esp.c

index b69edb473295d8a02ce8a8d864057d03c0827117..fbb29dbb1e503947ac3cdec7a268cf32a685da87 100644 (file)
@@ -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;
index 64ec6bb84550a9a0af290375319bb38510fcb4f0..97816a0e6240a955ea7c6aa0f7ddef35430fa346 100644 (file)
@@ -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,
index c73760d3cf83521f5c97e2f0b4c24860541edfef..00cd7c0ccc769833dcca75159419e0c59edad651 100644 (file)
@@ -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 *);
index 60a88a95a8e23f2add54e66bf419f757a887642b..0c842fb29aa05cae3cf2a6682bf133595956a848 100644 (file)
@@ -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;
index 6d23ab5aee562f107e0cf262c6457ed02236cfd3..3f0061b004940beff0780a903877b672cd25fdf8 100644 (file)
@@ -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;
index d3489ac7ab28b6b041ae3ad31534d6937f10ea1c..30f67cbf4a7a9ea83c3aeceac19518f256264e8f 100644 (file)
@@ -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;
index 5dc38d35745b4b237eee3affc5202f993e036a5f..fb0611bfb209edda3aad4004289a7e2caf87419b 100644 (file)
@@ -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;
index 928c8adf5cb33f4faefab872beae878cd7b18b59..56cae22a4242ea705cd463637960367f3b1557af 100644 (file)
@@ -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;