Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1724198 > unrolled thread
| Started by | Colin King <colin.king@canonical.com> |
|---|---|
| First post | 2017-08-31 14:50 +0200 |
| Last post | 2017-08-31 18:40 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] input: byd: make array seq static, reduces object code size Colin King <colin.king@canonical.com> - 2017-08-31 14:50 +0200
Re: [PATCH] input: byd: make array seq static, reduces object code size Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-08-31 18:40 +0200
| From | Colin King <colin.king@canonical.com> |
|---|---|
| Date | 2017-08-31 14:50 +0200 |
| Subject | [PATCH] input: byd: make array seq static, reduces object code size |
| Message-ID | <ukx50-5GR-9@gated-at.bofh.it> |
From: Colin Ian King <colin.king@canonical.com>
Don't populate the array seq on the stack, instead make it static.
Makes the object code smaller by over 1100 bytes:
Before:
text data bss dec hex filename
6152 1216 64 7432 1d08 drivers/input/mouse/byd.o
After:
text data bss dec hex filename
4974 1280 64 6318 18ae drivers/input/mouse/byd.o
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/input/mouse/byd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/mouse/byd.c b/drivers/input/mouse/byd.c
index b27aa637f877..b64b81599f7e 100644
--- a/drivers/input/mouse/byd.c
+++ b/drivers/input/mouse/byd.c
@@ -344,7 +344,7 @@ static int byd_reset_touchpad(struct psmouse *psmouse)
u8 param[4];
size_t i;
- const struct {
+ static const struct {
u16 command;
u8 arg;
} seq[] = {
--
2.14.1
[toc] | [next] | [standalone]
| From | Dmitry Torokhov <dmitry.torokhov@gmail.com> |
|---|---|
| Date | 2017-08-31 18:40 +0200 |
| Subject | Re: [PATCH] input: byd: make array seq static, reduces object code size |
| Message-ID | <ukAFB-7XG-43@gated-at.bofh.it> |
| In reply to | #1724198 |
On Thu, Aug 31, 2017 at 01:47:30PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Don't populate the array seq on the stack, instead make it static.
> Makes the object code smaller by over 1100 bytes:
>
> Before:
> text data bss dec hex filename
> 6152 1216 64 7432 1d08 drivers/input/mouse/byd.o
>
> After:
> text data bss dec hex filename
> 4974 1280 64 6318 18ae drivers/input/mouse/byd.o
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied, thank you.
> ---
> drivers/input/mouse/byd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/mouse/byd.c b/drivers/input/mouse/byd.c
> index b27aa637f877..b64b81599f7e 100644
> --- a/drivers/input/mouse/byd.c
> +++ b/drivers/input/mouse/byd.c
> @@ -344,7 +344,7 @@ static int byd_reset_touchpad(struct psmouse *psmouse)
> u8 param[4];
> size_t i;
>
> - const struct {
> + static const struct {
> u16 command;
> u8 arg;
> } seq[] = {
> --
> 2.14.1
>
--
Dmitry
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web