diff options
author | Joe Perches <joe@perches.com> | 2020-02-17 16:59:54 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-02-19 11:08:52 +0100 |
commit | 10892847de816edf4f8f2151174dc557c4a3f63f (patch) | |
tree | 4799c1549ec4906b903c1bc9921d40a1dc54c586 /drivers/usb/storage/usb.c | |
parent | 28926994e5d7f049807119c48bd7b94c2d15fc95 (diff) | |
download | linux-10892847de816edf4f8f2151174dc557c4a3f63f.tar.gz linux-10892847de816edf4f8f2151174dc557c4a3f63f.tar.bz2 linux-10892847de816edf4f8f2151174dc557c4a3f63f.zip |
usb-storage: Use const to reduce object data size
Make structs const to reduce data size ~20KB.
Change function arguments and prototypes as necessary to compile.
$ size (x86-64 defconfig pre)
text data bss dec hex filename
12281 10948 480 23709 5c9d ./drivers/usb/storage/usb.o
111 10528 8 10647 2997 ./drivers/usb/storage/usual-tables.o
$ size (x86-64 defconfig post)
text data bss dec hex filename
22809 420 480 23709 5c9d drivers/usb/storage/usb.o
10551 0 0 10551 2937 drivers/usb/storage/usual-tables.o
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/cf13bd2d790ae3afbf5da55ea7bed12e00c5119d.camel@perches.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/storage/usb.c')
-rw-r--r-- | drivers/usb/storage/usb.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 9a79cd9762f3..94a64729dc27 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -121,12 +121,12 @@ MODULE_PARM_DESC(quirks, "supplemental list of device IDs and their quirks"); .initFunction = init_function, \ } -static struct us_unusual_dev us_unusual_dev_list[] = { +static const struct us_unusual_dev us_unusual_dev_list[] = { # include "unusual_devs.h" { } /* Terminating entry */ }; -static struct us_unusual_dev for_dynamic_ids = +static const struct us_unusual_dev for_dynamic_ids = USUAL_DEV(USB_SC_SCSI, USB_PR_BULK); #undef UNUSUAL_DEV @@ -583,7 +583,7 @@ EXPORT_SYMBOL_GPL(usb_stor_adjust_quirks); /* Get the unusual_devs entries and the string descriptors */ static int get_device_info(struct us_data *us, const struct usb_device_id *id, - struct us_unusual_dev *unusual_dev) + const struct us_unusual_dev *unusual_dev) { struct usb_device *dev = us->pusb_dev; struct usb_interface_descriptor *idesc = @@ -933,7 +933,7 @@ static unsigned int usb_stor_sg_tablesize(struct usb_interface *intf) int usb_stor_probe1(struct us_data **pus, struct usb_interface *intf, const struct usb_device_id *id, - struct us_unusual_dev *unusual_dev, + const struct us_unusual_dev *unusual_dev, struct scsi_host_template *sht) { struct Scsi_Host *host; @@ -1092,7 +1092,7 @@ static struct scsi_host_template usb_stor_host_template; static int storage_probe(struct usb_interface *intf, const struct usb_device_id *id) { - struct us_unusual_dev *unusual_dev; + const struct us_unusual_dev *unusual_dev; struct us_data *us; int result; int size; |