lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 25 Aug 2017 19:53:35 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Colin King <colin.king@...onical.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H . Peter Anvin" <hpa@...or.com>, x86@...nel.org,
        Lukas Wunner <lukas@...ner.de>,
        Bjorn Helgaas <bhelgaas@...gle.com>
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/platform/intel-mid: make several arrays static,
 makes code smaller

On Fri, 2017-08-25 at 17:32 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
> 
> Don't populate arrays on the stack, instead make them static .
> Makes the object code smaller by 76 bytes:
> 
> Before:
>    text	   data	    bss	    dec	    hex	
> filename
>    4217	   1540	    128	   5885	   16fd	
> arch/x86/platform/intel-mid/pwr.o
> 
> After:
>    text	   data	    bss	    dec	    hex	
> filename
>    3981	   1700	    128	   5809	   16b1	
> arch/x86/platform/intel-mid/pwr.o

Fine by me.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

> 
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
> ---
>  arch/x86/platform/intel-mid/pwr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/platform/intel-mid/pwr.c
> b/arch/x86/platform/intel-mid/pwr.c
> index ef03852ea6e8..49ec5b94c71f 100644
> --- a/arch/x86/platform/intel-mid/pwr.c
> +++ b/arch/x86/platform/intel-mid/pwr.c
> @@ -444,7 +444,7 @@ static int mid_set_initial_state(struct mid_pwr
> *pwr, const u32 *states)
>  static int pnw_set_initial_state(struct mid_pwr *pwr)
>  {
>  	/* On Penwell SRAM must stay powered on */
> -	const u32 states[] = {
> +	static const u32 states[] = {
>  		0xf00fffff,		/* PM_SSC(0) */
>  		0xffffffff,		/* PM_SSC(1) */
>  		0xffffffff,		/* PM_SSC(2) */
> @@ -455,7 +455,7 @@ static int pnw_set_initial_state(struct mid_pwr
> *pwr)
>  
>  static int tng_set_initial_state(struct mid_pwr *pwr)
>  {
> -	const u32 states[] = {
> +	static const u32 states[] = {
>  		0xffffffff,		/* PM_SSC(0) */
>  		0xffffffff,		/* PM_SSC(1) */
>  		0xffffffff,		/* PM_SSC(2) */

-- 
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Intel Finland Oy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ