diff options
author | Colin Ian King <colin.king@canonical.com> | 2017-09-12 07:38:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-09-18 06:44:11 -0400 |
commit | 38502ef49f96f7fe25fcb3aaa904a570df955c2c (patch) | |
tree | 4f00dcf694309a2a032a0786e0f337b2bc571642 | |
parent | 4c87b3e58d0204d31eb00c76f323ecffd1960a91 (diff) |
usb: storage: make const arrays static, reduces object code size
Don't populate const arrays on the stack, instead make them
static. Makes the object code smaller by over 1070 bytes:
Before:
text data bss dec hex filename
3505 880 0 4385 1121 drivers/usb/storage/option_ms.o
After:
text data bss dec hex filename
2269 1040 0 3309 ced drivers/usb/storage/option_ms.o
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/storage/option_ms.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/storage/option_ms.c b/drivers/usb/storage/option_ms.c index 57282f12317b..4a73cd4783ae 100644 --- a/drivers/usb/storage/option_ms.c +++ b/drivers/usb/storage/option_ms.c | |||
@@ -41,7 +41,7 @@ MODULE_PARM_DESC(option_zero_cd, "ZeroCD mode (1=Force Modem (default)," | |||
41 | 41 | ||
42 | static int option_rezero(struct us_data *us) | 42 | static int option_rezero(struct us_data *us) |
43 | { | 43 | { |
44 | const unsigned char rezero_msg[] = { | 44 | static const unsigned char rezero_msg[] = { |
45 | 0x55, 0x53, 0x42, 0x43, 0x78, 0x56, 0x34, 0x12, | 45 | 0x55, 0x53, 0x42, 0x43, 0x78, 0x56, 0x34, 0x12, |
46 | 0x01, 0x00, 0x00, 0x00, 0x80, 0x00, 0x06, 0x01, | 46 | 0x01, 0x00, 0x00, 0x00, 0x80, 0x00, 0x06, 0x01, |
47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
@@ -87,7 +87,7 @@ out: | |||
87 | 87 | ||
88 | static int option_inquiry(struct us_data *us) | 88 | static int option_inquiry(struct us_data *us) |
89 | { | 89 | { |
90 | const unsigned char inquiry_msg[] = { | 90 | static const unsigned char inquiry_msg[] = { |
91 | 0x55, 0x53, 0x42, 0x43, 0x12, 0x34, 0x56, 0x78, | 91 | 0x55, 0x53, 0x42, 0x43, 0x12, 0x34, 0x56, 0x78, |
92 | 0x24, 0x00, 0x00, 0x00, 0x80, 0x00, 0x06, 0x12, | 92 | 0x24, 0x00, 0x00, 0x00, 0x80, 0x00, 0x06, 0x12, |
93 | 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, | 93 | 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, |