diff options
author | Joe Perches <joe@perches.com> | 2020-02-18 01:59:54 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-02-19 11:08:52 +0100 |
commit | 10892847de816edf4f8f2151174dc557c4a3f63f (patch) | |
tree | 4799c1549ec4906b903c1bc9921d40a1dc54c586 /drivers/usb/storage/usb.h | |
parent | usb: host: fhci-hcd: annotate PIPE_CONTROL switch case with fallthrough (diff) | |
download | linux-10892847de816edf4f8f2151174dc557c4a3f63f.tar.xz 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.h')
-rw-r--r-- | drivers/usb/storage/usb.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h index 85052cd66839..5850d624cac7 100644 --- a/drivers/usb/storage/usb.h +++ b/drivers/usb/storage/usb.h @@ -93,7 +93,8 @@ struct us_data { struct mutex dev_mutex; /* protect pusb_dev */ struct usb_device *pusb_dev; /* this usb_device */ struct usb_interface *pusb_intf; /* this interface */ - struct us_unusual_dev *unusual_dev; /* device-filter entry */ + const struct us_unusual_dev *unusual_dev; + /* device-filter entry */ unsigned long fflags; /* fixed flags from filter */ unsigned long dflags; /* dynamic atomic bitflags */ unsigned int send_bulk_pipe; /* cached pipe values */ @@ -185,7 +186,7 @@ extern int usb_stor_post_reset(struct usb_interface *iface); extern 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); extern int usb_stor_probe2(struct us_data *us); extern void usb_stor_disconnect(struct usb_interface *intf); |