Bluetooth: bpa10x: make array 'req' static, shrinks object size
authorColin Ian King <colin.king@canonical.com>
Sat, 6 Jan 2018 16:15:14 +0000 (16:15 +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 'req' on the stack but instead
make it static. Makes the object code smaller by over 40 bytes:

Before:
   text    data     bss     dec     hex filename
   8497    3408     128   12033    2f01 linux/drivers/bluetooth/bpa10x.o

After:
   text    data     bss     dec     hex filename
   8366    3496     128   11990    2ed6 linux/drivers/bluetooth/bpa10x.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/bpa10x.c

index 7971bfbd43215cf32e03d94ba4b1d7b115709f5e..801ea4ca65e4a43d2589e42fb4dcb3545e87d986 100644 (file)
@@ -259,7 +259,7 @@ static int bpa10x_flush(struct hci_dev *hdev)
 
 static int bpa10x_setup(struct hci_dev *hdev)
 {
-       const u8 req[] = { 0x07 };
+       static const u8 req[] = { 0x07 };
        struct sk_buff *skb;
 
        BT_DBG("%s", hdev->name);