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


Groups > linux.kernel > #1724405

Re: [PATCH] input: byd: make array seq static, reduces object code size

Path csiph.com!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From Dmitry Torokhov <dmitry.torokhov@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] input: byd: make array seq static, reduces object code size
Date Thu, 31 Aug 2017 18:40:03 +0200
Message-ID <ukAFB-7XG-43@gated-at.bofh.it> (permalink)
References <ukx50-5GR-9@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=eiIciZjcbBhJmatCxOYYydmu0Zg3r8w1jPcOwueV0cE=; b=hc3j2xlWBtjxj210YShMNl25xvfJJp/DGmOOFh3QIkoJ1+CI6I8WhvWmPqZ0o8yjOd uq9ZJHAGjlI5jxlsPlzOCWvGvMrkCUOJc36IVo5DqxPeIVfvvh7U2h9C1OqLg8jzhpa0 l4k+xv1DXd4WUNo6Or4zG6ZilbDwSdmAm0+0ihLXErbifNS1SHZiIsPbE5VXUD3S/sbN 0SM2RrW0jgJ6Bm3u434bpI14qyGRWqXFlE9Jf3fJP3gwFvOu1H4bTz9UoA65hK92OXhb Du0DrXCkVQEpTdqWWV6z8tE58bpNExib0hFSOSC6N5fJSIdhSUGfEogMOKWNCIxcKfkC k/FA==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=eiIciZjcbBhJmatCxOYYydmu0Zg3r8w1jPcOwueV0cE=; b=jzzaF02ULOmzRK9T06FgLS+x7oUrzhEZzkfUnGeCjSLTTT3l2APztasDMYaH+tHwFp UXVxpdeemxxEeRHiElOoEaO2HjMrdfuYv+xNuHRWL51jkJIPwXe8nd8taT3hrMqcgyxe 2vAP7xXcivwNwOXY+hm/4vsr2g0Y8ZXQkxePccFlXB3UWIuKq8FPYYRPATmf4Wday986 eVlk3ASAHZNKkUDUGkUkXToS9KN2c6UJaFCUZitEQvmkLBPYVi/a5rEVQQf/9DhpIULl fyn+WxF5quRe4BBFX9DPqVlniilweLSW1VqaXbawnJC3IeliP0i71nHuZWjVFdUBcnSe m2TQ==
X-Gm-Message-State AHYfb5hmsK+2tTAp1NCjugXjoQnCkXYqA3nr9ZFLQl3uZobWg3YX0RZp jq5lWv02KlmNOaeoQEA=
X-Google-SMTP-Source ADKCNb49sPtnhqFmkC22O9Nirc8GAZCIMW1UoabXVx+4oibQkypxZccC2T1q0bHURYKLZDlBS+Si0g==
X-Received by 10.98.32.152 with SMTP id m24mr3012215pfj.299.1504197068978; Thu, 31 Aug 2017 09:31:08 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 41
Organization linux.* mail to news gateway
X-Original-Cc linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Thu, 31 Aug 2017 09:31:04 -0700
X-Original-Message-ID <20170831163104.GA14370@dtor-ws>
X-Original-References <20170831124730.27047-1-colin.king@canonical.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1724405

Show key headers only | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[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

csiph-web