Skip to content

Commit 04d1fa4

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: usb: uas: Declare two host templates and host template pointers const
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>
1 parent f2e2fe3 commit 04d1fa4

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/usb/image/microtek.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ static int mts_scsi_queuecommand_lck(struct scsi_cmnd *srb)
620620

621621
static DEF_SCSI_QCMD(mts_scsi_queuecommand)
622622

623-
static struct scsi_host_template mts_scsi_host_template = {
623+
static const struct scsi_host_template mts_scsi_host_template = {
624624
.module = THIS_MODULE,
625625
.name = "microtekX6",
626626
.proc_name = "microtekX6",

drivers/usb/storage/uas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ static int uas_slave_configure(struct scsi_device *sdev)
894894
return 0;
895895
}
896896

897-
static struct scsi_host_template uas_host_template = {
897+
static const struct scsi_host_template uas_host_template = {
898898
.module = THIS_MODULE,
899899
.name = "uas",
900900
.queuecommand = uas_queuecommand,

drivers/usb/storage/usb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ int usb_stor_probe1(struct us_data **pus,
937937
struct usb_interface *intf,
938938
const struct usb_device_id *id,
939939
const struct us_unusual_dev *unusual_dev,
940-
struct scsi_host_template *sht)
940+
const struct scsi_host_template *sht)
941941
{
942942
struct Scsi_Host *host;
943943
struct us_data *us;

drivers/usb/storage/usb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ extern int usb_stor_probe1(struct us_data **pus,
187187
struct usb_interface *intf,
188188
const struct usb_device_id *id,
189189
const struct us_unusual_dev *unusual_dev,
190-
struct scsi_host_template *sht);
190+
const struct scsi_host_template *sht);
191191
extern int usb_stor_probe2(struct us_data *us);
192192
extern void usb_stor_disconnect(struct usb_interface *intf);
193193

0 commit comments

Comments
 (0)