Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Colin Ian King and committed by
Greg Kroah-Hartman
8af620f0 17c08996

+1 -1
+1 -1
drivers/usb/gadget/udc/renesas_usb3.c
··· 2058 2058 const struct usb_endpoint_descriptor *desc) 2059 2059 { 2060 2060 int i; 2061 - const u32 max_packet_array[] = {8, 16, 32, 64, 512}; 2061 + static const u32 max_packet_array[] = {8, 16, 32, 64, 512}; 2062 2062 u32 mpkt = PN_RAMMAP_MPKT(1024); 2063 2063 2064 2064 for (i = 0; i < ARRAY_SIZE(max_packet_array); i++) {