| From 9f7c4bf1285af7b5ed33355cf03b9c58d3404c2e Mon Sep 17 00:00:00 2001 |
| From: Colin Ian King <colin.king@canonical.com> |
| Date: Thu, 2 Nov 2017 15:53:25 +0000 |
| Subject: [PATCH 0233/1795] usb: gadget: udc: renesas_usb3: make const array |
| max_packet_array static |
| |
| Don't populate the const array max_packet_array on the stack, instead make |
| it static. Makes the object code smaller by over 90 bytes: |
| |
| Before: |
| text data bss dec hex filename |
| 34337 5612 128 40077 9c8d renesas_usb3.o |
| |
| After: |
| text data bss dec hex filename |
| 34149 5708 128 39985 9c31 renesas_usb3.o |
| |
| (gcc version 7.2.0 x86_64) |
| |
| Signed-off-by: Colin Ian King <colin.king@canonical.com> |
| Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| (cherry picked from commit 8af620f06f015eb9e9062f6398204ee011b5ef22) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| --- |
| drivers/usb/gadget/udc/renesas_usb3.c | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c |
| index 0a74919bd754..7e0548f6bd9e 100644 |
| --- a/drivers/usb/gadget/udc/renesas_usb3.c |
| +++ b/drivers/usb/gadget/udc/renesas_usb3.c |
| @@ -2066,7 +2066,7 @@ static u32 usb3_calc_rammap_val(struct renesas_usb3_ep *usb3_ep, |
| const struct usb_endpoint_descriptor *desc) |
| { |
| int i; |
| - const u32 max_packet_array[] = {8, 16, 32, 64, 512}; |
| + static const u32 max_packet_array[] = {8, 16, 32, 64, 512}; |
| u32 mpkt = PN_RAMMAP_MPKT(1024); |
| |
| for (i = 0; i < ARRAY_SIZE(max_packet_array); i++) { |
| -- |
| 2.19.0 |
| |