]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
Bluetooth: btintel: make array 'param' static, shrinks object size
authorColin Ian King <colin.king@canonical.com>
Sat, 6 Jan 2018 16:23:28 +0000 (16:23 +0000)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 8 Jan 2018 20:44:22 +0000 (21:44 +0100)
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>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btintel.c

index 4459555c9d8822094674119df8ee3e5b3077686e..07f00e422e85bf5cffb1fdbee3196e0cbc3c8c18 100644 (file)
@@ -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);