lkml.org 
[lkml]   [2017]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] usb: gadget: udc: renesas_usb3: make const array max_packet_array static
Date
From: Colin Ian King <colin.king@canonical.com>

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>
---
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 ed84f5158a38..cb461b8f4509 100644
--- a/drivers/usb/gadget/udc/renesas_usb3.c
+++ b/drivers/usb/gadget/udc/renesas_usb3.c
@@ -2058,7 +2058,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.14.1
\
 
 \ /
  Last update: 2017-11-02 16:54    [W:0.027 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site