Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1727306 > unrolled thread

[PATCH] input: surface3_spi: make const array header static, reduces object code size

Started byColin King <colin.king@canonical.com>
First post2017-09-06 12:00 +0200
Last post2017-09-07 23:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] input: surface3_spi: make const array header static, reduces object code size Colin King <colin.king@canonical.com> - 2017-09-06 12:00 +0200
    Re: [PATCH] input: surface3_spi: make const array header static,  reduces object code size Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-09-07 23:40 +0200

#1727306 — [PATCH] input: surface3_spi: make const array header static, reduces object code size

FromColin King <colin.king@canonical.com>
Date2017-09-06 12:00 +0200
Subject[PATCH] input: surface3_spi: make const array header static, reduces object code size
Message-ID<umFhN-8my-43@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

Don't populate the const array header on the stack, instead make it
static.  Makes the object code smaller by over 180 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
   6003	   1536	      0	   7539	   1d73	surface3_spi.o

After:
   text	   data	    bss	    dec	    hex	filename
   5726	   1632	      0	   7358	   1cbe	surface3_spi.o

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/input/touchscreen/surface3_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/surface3_spi.c b/drivers/input/touchscreen/surface3_spi.c
index e12fb9b63f31..ecba847889b5 100644
--- a/drivers/input/touchscreen/surface3_spi.c
+++ b/drivers/input/touchscreen/surface3_spi.c
@@ -173,7 +173,7 @@ static void surface3_spi_process_pen(struct surface3_ts_data *ts_data, u8 *data)
 
 static void surface3_spi_process(struct surface3_ts_data *ts_data)
 {
-	const char header[] = {
+	static const char header[] = {
 		0xff, 0xff, 0xff, 0xff, 0xa5, 0x5a, 0xe7, 0x7e, 0x01
 	};
 	u8 *data = ts_data->rd_buf;
-- 
2.14.1

[toc] | [next] | [standalone]


#1728459 — Re: [PATCH] input: surface3_spi: make const array header static, reduces object code size

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-09-07 23:40 +0200
SubjectRe: [PATCH] input: surface3_spi: make const array header static, reduces object code size
Message-ID<uncGJ-5J7-19@gated-at.bofh.it>
In reply to#1727306
On Wed, Sep 06, 2017 at 10:51:37AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the const array header on the stack, instead make it
> static.  Makes the object code smaller by over 180 bytes:
> 
> Before:
>    text	   data	    bss	    dec	    hex	filename
>    6003	   1536	      0	   7539	   1d73	surface3_spi.o
> 
> After:
>    text	   data	    bss	    dec	    hex	filename
>    5726	   1632	      0	   7358	   1cbe	surface3_spi.o
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---

Applied, thank you.

>  drivers/input/touchscreen/surface3_spi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/surface3_spi.c b/drivers/input/touchscreen/surface3_spi.c
> index e12fb9b63f31..ecba847889b5 100644
> --- a/drivers/input/touchscreen/surface3_spi.c
> +++ b/drivers/input/touchscreen/surface3_spi.c
> @@ -173,7 +173,7 @@ static void surface3_spi_process_pen(struct surface3_ts_data *ts_data, u8 *data)
>  
>  static void surface3_spi_process(struct surface3_ts_data *ts_data)
>  {
> -	const char header[] = {
> +	static const char header[] = {
>  		0xff, 0xff, 0xff, 0xff, 0xa5, 0x5a, 0xe7, 0x7e, 0x01
>  	};
>  	u8 *data = ts_data->rd_buf;
> -- 
> 2.14.1
> 

-- 
Dmitry

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web