mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btintel: make array 'param' static, shrinks object size
@ 2018-01-06 16:23 Colin King
  2018-01-06 16:43 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-01-06 16:23 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, linux-bluetooth
  Cc: kernel-janitors, linux-kernel

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

Don't populate the const read-only array 'param' on the stack but instead
make it static. Makes the object code smaller by nearly 20 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  11605	   2629	     64	  14298	   37da	linux/drivers/bluetooth/btintel.o

After:
   text	   data	    bss	    dec	    hex	filename
  11531	   2685	     64	  14280	   37c8	linux/drivers/bluetooth/btintel.o

(gcc version 7.2.0 x86_64)

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

diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index 4459555c9d88..07f00e422e85 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -75,7 +75,7 @@ EXPORT_SYMBOL_GPL(btintel_check_bdaddr);
 
 int btintel_enter_mfg(struct hci_dev *hdev)
 {
-	const u8 param[] = { 0x01, 0x00 };
+	static const u8 param[] = { 0x01, 0x00 };
 	struct sk_buff *skb;
 
 	skb = __hci_cmd_sync(hdev, 0xfc11, 2, param, HCI_CMD_TIMEOUT);
-- 
2.15.1

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

end of thread, other threads:[~2018-01-06 16:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-06 16:23 [PATCH] Bluetooth: btintel: make array 'param' static, shrinks object size Colin King
2018-01-06 16:43 ` Marcel Holtmann

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

all inboxes | Powered by JetHome®