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/usual-tables.c | |
parent | 28926994e5d7f049807119c48bd7b94c2d15fc95 (diff) | |
download | lwn-10892847de816edf4f8f2151174dc557c4a3f63f.tar.gz lwn-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/usual-tables.c')
-rw-r--r-- | drivers/usb/storage/usual-tables.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/storage/usual-tables.c b/drivers/usb/storage/usual-tables.c index cfd12e523678..529512827d8f 100644 --- a/drivers/usb/storage/usual-tables.c +++ b/drivers/usb/storage/usual-tables.c @@ -40,7 +40,7 @@ .driver_info = (flags) \ } -struct usb_device_id usb_storage_usb_ids[] = { +const struct usb_device_id usb_storage_usb_ids[] = { # include "unusual_devs.h" { } /* Terminating entry */ }; @@ -68,7 +68,7 @@ struct ignore_entry { .bcdmax = bcdDeviceMax, \ } -static struct ignore_entry ignore_ids[] = { +static const struct ignore_entry ignore_ids[] = { # include "unusual_alauda.h" # include "unusual_cypress.h" # include "unusual_datafab.h" @@ -92,7 +92,7 @@ int usb_usual_ignore_device(struct usb_interface *intf) { struct usb_device *udev; unsigned vid, pid, bcd; - struct ignore_entry *p; + const struct ignore_entry *p; udev = interface_to_usbdev(intf); vid = le16_to_cpu(udev->descriptor.idVendor); |