* [PATCH] Bluetooth: make hw_err static, reduces object code size
@ 2019-01-24 17:22 Colin King
2019-01-25 7:54 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2019-01-24 17:22 UTC (permalink / raw)
To: Marcel Holtmann, Johan Hedberg, David S . Miller, linux-bluetooth,
netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Don't populate the const array hw_err on the stack but instead make
it static. Makes the object code smaller by 45 bytes:
Before:
text data bss dec hex filename
100880 21090 1088 123058 1e0b2 linux/net/bluetooth/hci_core.o
After:
text data bss dec hex filename
100739 21186 1088 123013 1e085 linux/net/bluetooth/hci_core.o
(gcc version 8.2.0 x86_64)
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
net/bluetooth/hci_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 7352fe85674b..40cd6b48473a 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -3401,7 +3401,7 @@ EXPORT_SYMBOL(hci_resume_dev);
/* Reset HCI device */
int hci_reset_dev(struct hci_dev *hdev)
{
- const u8 hw_err[] = { HCI_EV_HARDWARE_ERROR, 0x01, 0x00 };
+ static const u8 hw_err[] = { HCI_EV_HARDWARE_ERROR, 0x01, 0x00 };
struct sk_buff *skb;
skb = bt_skb_alloc(3, GFP_ATOMIC);
--
2.19.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] Bluetooth: make hw_err static, reduces object code size
2019-01-24 17:22 [PATCH] Bluetooth: make hw_err static, reduces object code size Colin King
@ 2019-01-25 7:54 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2019-01-25 7:54 UTC (permalink / raw)
To: Colin King
Cc: Johan Hedberg, David S. Miller, linux-bluetooth, netdev,
kernel-janitors, linux-kernel
Hi Colin,
> Don't populate the const array hw_err on the stack but instead make
> it static. Makes the object code smaller by 45 bytes:
>
> Before:
> text data bss dec hex filename
> 100880 21090 1088 123058 1e0b2 linux/net/bluetooth/hci_core.o
>
> After:
> text data bss dec hex filename
> 100739 21186 1088 123013 1e085 linux/net/bluetooth/hci_core.o
>
> (gcc version 8.2.0 x86_64)
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> net/bluetooth/hci_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-25 7:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-24 17:22 [PATCH] Bluetooth: make hw_err static, reduces object code size Colin King
2019-01-25 7:54 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox