Skip to content

Commit

Permalink
Bluetooth: btintel: make array 'param' static, shrinks object size
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Colin Ian King authored and Marcel Holtmann committed Jan 8, 2018
1 parent cca3283 commit 948c7ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/bluetooth/btintel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 948c7ca

Please sign in to comment.