linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: elan: Make array buf static, shrinks object size
@ 2018-09-26  8:41 Colin King
  2019-01-24 16:54 ` Colin Ian King
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2018-09-26  8:41 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, linux-input
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Don't populate the array buf on the stack but instead make it
static. Makes the object code smaller by 43 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
   7769	   1520	      0	   9289	   2449	drivers/hid/hid-elan.o

After:
   text	   data	    bss	    dec	    hex	filename
   7662	   1584	      0	   9246	   241e	drivers/hid/hid-elan.o

(gcc version 8.2.0 x86_64)

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

diff --git a/drivers/hid/hid-elan.c b/drivers/hid/hid-elan.c
index 07e26c3567eb..05377eec2cb2 100644
--- a/drivers/hid/hid-elan.c
+++ b/drivers/hid/hid-elan.c
@@ -393,7 +393,7 @@ static int elan_start_multitouch(struct hid_device *hdev)
 	 * This byte sequence will enable multitouch mode and disable
 	 * mouse emulation
 	 */
-	const unsigned char buf[] = { 0x0D, 0x00, 0x03, 0x21, 0x00 };
+	static const unsigned char buf[] = { 0x0D, 0x00, 0x03, 0x21, 0x00 };
 	unsigned char *dmabuf = kmemdup(buf, sizeof(buf), GFP_KERNEL);
 
 	if (!dmabuf)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: elan: Make array buf static, shrinks object size
  2018-09-26  8:41 [PATCH] HID: elan: Make array buf static, shrinks object size Colin King
@ 2019-01-24 16:54 ` Colin Ian King
  2019-01-25 15:53   ` Jiri Kosina
  0 siblings, 1 reply; 3+ messages in thread
From: Colin Ian King @ 2019-01-24 16:54 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, linux-input
  Cc: kernel-janitors, linux-kernel

ping?

On 26/09/2018 09:41, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Don't populate the array buf on the stack but instead make it
> static. Makes the object code smaller by 43 bytes:
> 
> Before:
>    text	   data	    bss	    dec	    hex	filename
>    7769	   1520	      0	   9289	   2449	drivers/hid/hid-elan.o
> 
> After:
>    text	   data	    bss	    dec	    hex	filename
>    7662	   1584	      0	   9246	   241e	drivers/hid/hid-elan.o
> 
> (gcc version 8.2.0 x86_64)
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/hid/hid-elan.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-elan.c b/drivers/hid/hid-elan.c
> index 07e26c3567eb..05377eec2cb2 100644
> --- a/drivers/hid/hid-elan.c
> +++ b/drivers/hid/hid-elan.c
> @@ -393,7 +393,7 @@ static int elan_start_multitouch(struct hid_device *hdev)
>  	 * This byte sequence will enable multitouch mode and disable
>  	 * mouse emulation
>  	 */
> -	const unsigned char buf[] = { 0x0D, 0x00, 0x03, 0x21, 0x00 };
> +	static const unsigned char buf[] = { 0x0D, 0x00, 0x03, 0x21, 0x00 };
>  	unsigned char *dmabuf = kmemdup(buf, sizeof(buf), GFP_KERNEL);
>  
>  	if (!dmabuf)
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: elan: Make array buf static, shrinks object size
  2019-01-24 16:54 ` Colin Ian King
@ 2019-01-25 15:53   ` Jiri Kosina
  0 siblings, 0 replies; 3+ messages in thread
From: Jiri Kosina @ 2019-01-25 15:53 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Benjamin Tissoires, linux-input, kernel-janitors, linux-kernel

On Thu, 24 Jan 2019, Colin Ian King wrote:

> ping?

I don't think I've ever seen the original patch in my inbox. Could you 
please just resend it?

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-25 15:53 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:41 [PATCH] HID: elan: Make array buf static, shrinks object size Colin King
2019-01-24 16:54 ` Colin Ian King
2019-01-25 15:53   ` Jiri Kosina

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).