diff mbox series

[80/81] usb: uas: Declare two host templates and host template pointers const

Message ID 20230304003103.2572793-81-bvanassche@acm.org
State Superseded
Headers show
Series None | expand

Commit Message

Bart Van Assche March 4, 2023, 12:31 a.m. UTC
Improve source code documentation by constifying host templates that are
not modified.

Cc: Oliver Neukum <oneukum@suse.com>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/usb/image/microtek.c | 2 +-
 drivers/usb/storage/uas.c    | 2 +-
 drivers/usb/storage/usb.c    | 2 +-
 drivers/usb/storage/usb.h    | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

Comments

Alan Stern March 4, 2023, 3:51 p.m. UTC | #1
On Fri, Mar 03, 2023 at 04:31:02PM -0800, Bart Van Assche wrote:
> Improve source code documentation by constifying host templates that are
> not modified.
> 
> Cc: Oliver Neukum <oneukum@suse.com>
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---

For the usb-storage parts:

Acked-by: Alan Stern <stern@rowland.harvard.edu>

>  drivers/usb/image/microtek.c | 2 +-
>  drivers/usb/storage/uas.c    | 2 +-
>  drivers/usb/storage/usb.c    | 2 +-
>  drivers/usb/storage/usb.h    | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
> index 874ea4b54ced..8c8fa71c69c4 100644
> --- a/drivers/usb/image/microtek.c
> +++ b/drivers/usb/image/microtek.c
> @@ -620,7 +620,7 @@ static int mts_scsi_queuecommand_lck(struct scsi_cmnd *srb)
>  
>  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",
> diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
> index de3836412bf3..2583ee9815c5 100644
> --- a/drivers/usb/storage/uas.c
> +++ b/drivers/usb/storage/uas.c
> @@ -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,
> diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
> index ed7c6ad96a74..7b36a3334fb3 100644
> --- a/drivers/usb/storage/usb.c
> +++ b/drivers/usb/storage/usb.c
> @@ -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;
> diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
> index 0451fac1adce..fd3f32670873 100644
> --- a/drivers/usb/storage/usb.h
> +++ b/drivers/usb/storage/usb.h
> @@ -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);
>
Oliver Neukum March 6, 2023, 12:27 p.m. UTC | #2
On 04.03.23 01:31, Bart Van Assche wrote:
> Improve source code documentation by constifying host templates that are
> not modified.
> 
> Cc: Oliver Neukum <oneukum@suse.com>
> Cc: linux-usb@vger.kernel.org
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Oliver Neukum <oneukum@suse.com>
diff mbox series

Patch

diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c
index 874ea4b54ced..8c8fa71c69c4 100644
--- a/drivers/usb/image/microtek.c
+++ b/drivers/usb/image/microtek.c
@@ -620,7 +620,7 @@  static int mts_scsi_queuecommand_lck(struct scsi_cmnd *srb)
 
 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",
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index de3836412bf3..2583ee9815c5 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -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,
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index ed7c6ad96a74..7b36a3334fb3 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -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;
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
index 0451fac1adce..fd3f32670873 100644
--- a/drivers/usb/storage/usb.h
+++ b/drivers/usb/storage/usb.h
@@ -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);