* [PATCH] Bluetooth: btrtl: Make array extension_sig static, shrinks object size
@ 2018-09-26 8:32 Colin King
2018-09-27 10:27 ` Marcel Holtmann
0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2018-09-26 8:32 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 array extension_sig on the stack but instead make it
static. Makes the object code smaller by 75 bytes:
Before:
text data bss dec hex filename
14325 4920 0 19245 4b2d drivers/bluetooth/btrtl.o
After:
text data bss dec hex filename
14186 4984 0 19170 4ae2 drivers/bluetooth/btrtl.o
(gcc version 8.2.0 x86_64)
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/bluetooth/btrtl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 7f9ea8e4c1b2..52a9a55057c0 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -206,7 +206,7 @@ static int rtlbt_parse_firmware(struct hci_dev *hdev,
struct btrtl_device_info *btrtl_dev,
unsigned char **_buf)
{
- const u8 extension_sig[] = { 0x51, 0x04, 0xfd, 0x77 };
+ static const u8 extension_sig[] = { 0x51, 0x04, 0xfd, 0x77 };
struct rtl_epatch_header *epatch_info;
unsigned char *buf;
int i, len;
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: btrtl: Make array extension_sig static, shrinks object size
2018-09-26 8:32 [PATCH] Bluetooth: btrtl: Make array extension_sig static, shrinks object size Colin King
@ 2018-09-27 10:27 ` Marcel Holtmann
0 siblings, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2018-09-27 10:27 UTC (permalink / raw)
To: Colin King; +Cc: Johan Hedberg, linux-bluetooth, kernel-janitors, linux-kernel
Hi Colin,
> Don't populate the array extension_sig on the stack but instead make it
> static. Makes the object code smaller by 75 bytes:
>
> Before:
> text data bss dec hex filename
> 14325 4920 0 19245 4b2d drivers/bluetooth/btrtl.o
>
> After:
> text data bss dec hex filename
> 14186 4984 0 19170 4ae2 drivers/bluetooth/btrtl.o
>
> (gcc version 8.2.0 x86_64)
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/bluetooth/btrtl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] Bluetooth: btrtl: make array extension_sig static, shrinks object size
@ 2018-09-04 16:01 Colin King
0 siblings, 0 replies; 3+ messages in thread
From: Colin King @ 2018-09-04 16:01 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 array extension_sig on the stack but instead make it
static. Makes the object code smaller by 59 bytes:
Before:
text data bss dec hex filename
14366 4920 0 19286 4b56 linux/drivers/bluetooth/btrtl.o
After:
text data bss dec hex filename
14243 4984 0 19227 4b1b linux/drivers/bluetooth/btrtl.o
(gcc version 8.2.0 x86_64)
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/bluetooth/btrtl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 7f9ea8e4c1b2..52a9a55057c0 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -206,7 +206,7 @@ static int rtlbt_parse_firmware(struct hci_dev *hdev,
struct btrtl_device_info *btrtl_dev,
unsigned char **_buf)
{
- const u8 extension_sig[] = { 0x51, 0x04, 0xfd, 0x77 };
+ static const u8 extension_sig[] = { 0x51, 0x04, 0xfd, 0x77 };
struct rtl_epatch_header *epatch_info;
unsigned char *buf;
int i, len;
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-09-27 10:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-26 8:32 [PATCH] Bluetooth: btrtl: Make array extension_sig static, shrinks object size Colin King
2018-09-27 10:27 ` Marcel Holtmann
-- strict thread matches above, loose matches on Subject: below --
2018-09-04 16:01 [PATCH] Bluetooth: btrtl: make " Colin King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).