Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1680852 > unrolled thread

[PATCH] usb: renesas_usbhs: make array type_array static const

Started byColin King <colin.king@canonical.com>
First post2017-07-04 12:40 +0200
Last post2017-07-04 12:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] usb: renesas_usbhs: make array type_array static const Colin King <colin.king@canonical.com> - 2017-07-04 12:40 +0200

#1680852 — [PATCH] usb: renesas_usbhs: make array type_array static const

FromColin King <colin.king@canonical.com>
Date2017-07-04 12:40 +0200
Subject[PATCH] usb: renesas_usbhs: make array type_array static const
Message-ID<tZtpn-72a-1@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

Array type_array can be made static const rather than being
populated on the stack. Makes the object code smaller:

Before:
   text    data     bss     dec     hex filename
   8087    1496       0    9583    256f drivers/usb/renesas_usbhs/pipe.o

After:
   text    data     bss     dec     hex filename
   7883    1584       0    9467    24fb drivers/usb/renesas_usbhs/pipe.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/usb/renesas_usbhs/pipe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/renesas_usbhs/pipe.c b/drivers/usb/renesas_usbhs/pipe.c
index 9396a8c14af8..d811f0550c04 100644
--- a/drivers/usb/renesas_usbhs/pipe.c
+++ b/drivers/usb/renesas_usbhs/pipe.c
@@ -401,7 +401,7 @@ static int usbhsp_setup_pipecfg(struct usbhs_pipe *pipe, int is_host,
 	u16 dir = 0;
 	u16 epnum = 0;
 	u16 shtnak = 0;
-	u16 type_array[] = {
+	static const u16 type_array[] = {
 		[USB_ENDPOINT_XFER_BULK] = TYPE_BULK,
 		[USB_ENDPOINT_XFER_INT]  = TYPE_INT,
 		[USB_ENDPOINT_XFER_ISOC] = TYPE_ISO,
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web