]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
scsi: usb: uas: Declare two host templates and host template pointers const
authorBart Van Assche <bvanassche@acm.org>
Wed, 22 Mar 2023 19:55:15 +0000 (12:55 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 24 Mar 2023 23:20:00 +0000 (19:20 -0400)
Improve source code documentation by constifying host templates that are
not modified.

Acked-by: Alan Stern <stern@rowland.harvard.edu> (for usb-storage)
Acked-by: Oliver Neukum <oneukum@suse.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Oliver Neukum <oneukum@suse.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230322195515.1267197-81-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/usb/image/microtek.c
drivers/usb/storage/uas.c
drivers/usb/storage/usb.c
drivers/usb/storage/usb.h

index 874ea4b54ced81a4366a171efbd68889939548bf..8c8fa71c69c411710bb059bb63ab6756194eb65d 100644 (file)
@@ -620,7 +620,7 @@ out:
 
 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",
index de3836412bf32ecc97b12971ae3b7303fbb01fd3..2583ee9815c556f3c1c54fc4b9643fd5e33f98b5 100644 (file)
@@ -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,
index ed7c6ad96a743622083d15dd53c4b074538b9e28..7b36a3334fb344fbe28cda2eb5268185024ba091 100644 (file)
@@ -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;
index 0451fac1adce74f4c7db63f3437af6835a503543..fd3f326708730d21cac32708c10d712346412484 100644 (file)
@@ -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);