Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] nfc: s3fwrn5: make array match static const, reduces object code size
@ 2017-09-19 14:25 Colin King
  2017-11-06  0:03 ` Samuel Ortiz
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-09-19 14:25 UTC (permalink / raw)
  To: Robert Baldyga, Krzysztof Opasiak, Samuel Ortiz, linux-nfc,
	linux-wireless
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Don't populate the read-only array match on the stack, instead make
it static const.  Makes the object code smaller by over 310 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
   8304	   1084	    128	   9516	   252c	drivers/nfc/s3fwrn5/firmware.o

After:
   text	   data	    bss	    dec	    hex	filename
   7894	   1180	    128	   9202	   23f2	drivers/nfc/s3fwrn5/firmware.o

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

diff --git a/drivers/nfc/s3fwrn5/firmware.c b/drivers/nfc/s3fwrn5/firmware.c
index 38548bd970cd..b7828fb252f2 100644
--- a/drivers/nfc/s3fwrn5/firmware.c
+++ b/drivers/nfc/s3fwrn5/firmware.c
@@ -336,7 +336,7 @@ static int s3fwrn5_fw_get_base_addr(
 	struct s3fwrn5_fw_cmd_get_bootinfo_rsp *bootinfo, u32 *base_addr)
 {
 	int i;
-	struct {
+	static const struct {
 		u8 version[4];
 		u32 base_addr;
 	} match[] = {
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-06  0:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-19 14:25 [PATCH] nfc: s3fwrn5: make array match static const, reduces object code size Colin King
2017-11-06  0:03 ` Samuel Ortiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox